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"
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,
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_
))
35 } // namespace content