Mac: Don't use a dummy NSView as a gfx::AcceleratedWidget
[chromium-blink-merge.git] / content / browser / compositor / onscreen_display_client.cc
bloba071a213a28c3b750be768eada7f6e694893b2d2
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/browser/compositor/onscreen_display_client.h"
7 #include "cc/output/output_surface.h"
8 #include "cc/surfaces/surface_factory.h"
9 #include "cc/surfaces/surface_manager.h"
10 #include "content/common/host_shared_bitmap_manager.h"
12 namespace content {
14 OnscreenDisplayClient::OnscreenDisplayClient(
15 const scoped_refptr<cc::ContextProvider>& onscreen_context_provider,
16 scoped_ptr<cc::OutputSurface> software_surface,
17 cc::SurfaceManager* manager)
18 : onscreen_context_provider_(onscreen_context_provider),
19 software_surface_(software_surface.Pass()),
20 display_(new cc::Display(this,
21 manager,
22 HostSharedBitmapManager::current())) {
25 OnscreenDisplayClient::~OnscreenDisplayClient() {
28 scoped_ptr<cc::OutputSurface> OnscreenDisplayClient::CreateOutputSurface() {
29 if (!onscreen_context_provider_)
30 return software_surface_.Pass();
31 return make_scoped_ptr(new cc::OutputSurface(onscreen_context_provider_))
32 .Pass();
35 } // namespace content