Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: ui/android/delegated_frame_host_android.cc

Issue 2686243002: content/ui[Android]: Remove ContextProviderFactory. (Closed)
Patch Set: more rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/android/delegated_frame_host_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/android/delegated_frame_host_android.h" 5 #include "ui/android/delegated_frame_host_android.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "cc/layers/solid_color_layer.h" 10 #include "cc/layers/solid_color_layer.h"
11 #include "cc/layers/surface_layer.h" 11 #include "cc/layers/surface_layer.h"
12 #include "cc/output/compositor_frame.h" 12 #include "cc/output/compositor_frame.h"
13 #include "cc/output/copy_output_result.h" 13 #include "cc/output/copy_output_result.h"
14 #include "cc/surfaces/local_surface_id_allocator.h" 14 #include "cc/surfaces/local_surface_id_allocator.h"
15 #include "cc/surfaces/surface.h" 15 #include "cc/surfaces/surface.h"
16 #include "cc/surfaces/surface_id.h" 16 #include "cc/surfaces/surface_id.h"
17 #include "cc/surfaces/surface_manager.h" 17 #include "cc/surfaces/surface_manager.h"
18 #include "ui/android/context_provider_factory.h"
19 #include "ui/android/view_android.h" 18 #include "ui/android/view_android.h"
20 #include "ui/android/window_android_compositor.h" 19 #include "ui/android/window_android_compositor.h"
21 #include "ui/display/display.h" 20 #include "ui/display/display.h"
22 #include "ui/display/screen.h" 21 #include "ui/display/screen.h"
23 #include "ui/gfx/geometry/dip_util.h" 22 #include "ui/gfx/geometry/dip_util.h"
24 23
25 namespace ui { 24 namespace ui {
26 25
27 namespace { 26 namespace {
28 27
(...skipping 17 matching lines...) Expand all
46 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback, 45 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback,
47 std::unique_ptr<cc::CopyOutputResult> copy_output_result) { 46 std::unique_ptr<cc::CopyOutputResult> copy_output_result) {
48 readback_layer->RemoveFromParent(); 47 readback_layer->RemoveFromParent();
49 result_callback.Run(std::move(copy_output_result)); 48 result_callback.Run(std::move(copy_output_result));
50 } 49 }
51 50
52 } // namespace 51 } // namespace
53 52
54 DelegatedFrameHostAndroid::DelegatedFrameHostAndroid( 53 DelegatedFrameHostAndroid::DelegatedFrameHostAndroid(
55 ui::ViewAndroid* view, 54 ui::ViewAndroid* view,
55 cc::SurfaceManager* surface_manager,
56 Client* client, 56 Client* client,
57 const cc::FrameSinkId& frame_sink_id) 57 const cc::FrameSinkId& frame_sink_id)
58 : frame_sink_id_(frame_sink_id), view_(view), client_(client) { 58 : frame_sink_id_(frame_sink_id),
59 view_(view),
60 surface_manager_(surface_manager),
61 client_(client) {
59 DCHECK(view_); 62 DCHECK(view_);
60 DCHECK(client_); 63 DCHECK(client_);
61 64
62 surface_manager_ =
63 ui::ContextProviderFactory::GetInstance()->GetSurfaceManager();
64 local_surface_id_allocator_.reset(new cc::LocalSurfaceIdAllocator()); 65 local_surface_id_allocator_.reset(new cc::LocalSurfaceIdAllocator());
65 surface_manager_->RegisterFrameSinkId(frame_sink_id_); 66 surface_manager_->RegisterFrameSinkId(frame_sink_id_);
66 surface_factory_ = base::WrapUnique( 67 surface_factory_ = base::WrapUnique(
67 new cc::SurfaceFactory(frame_sink_id_, surface_manager_, this)); 68 new cc::SurfaceFactory(frame_sink_id_, surface_manager_, this));
68 } 69 }
69 70
70 DelegatedFrameHostAndroid::~DelegatedFrameHostAndroid() { 71 DelegatedFrameHostAndroid::~DelegatedFrameHostAndroid() {
71 DestroyDelegatedContent(); 72 DestroyDelegatedContent();
72 surface_factory_.reset(); 73 surface_factory_.reset();
73 DetachFromCompositor(); 74 DetachFromCompositor();
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 const cc::ReturnedResourceArray& resources) { 200 const cc::ReturnedResourceArray& resources) {
200 client_->ReturnResources(resources); 201 client_->ReturnResources(resources);
201 } 202 }
202 203
203 void DelegatedFrameHostAndroid::SetBeginFrameSource( 204 void DelegatedFrameHostAndroid::SetBeginFrameSource(
204 cc::BeginFrameSource* begin_frame_source) { 205 cc::BeginFrameSource* begin_frame_source) {
205 client_->SetBeginFrameSource(begin_frame_source); 206 client_->SetBeginFrameSource(begin_frame_source);
206 } 207 }
207 208
208 } // namespace ui 209 } // namespace ui
OLDNEW
« no previous file with comments | « ui/android/delegated_frame_host_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698