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

Side by Side Diff: cc/test/test_delegating_output_surface.cc

Issue 2166423002: ui::ContextFactory should not create SurfaceIdAllocators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed for android Created 4 years, 5 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 | « cc/surfaces/surface_id_allocator.cc ('k') | components/exo/surface.cc » ('j') | 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 "cc/test/test_delegating_output_surface.h" 5 #include "cc/test/test_delegating_output_surface.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "cc/output/begin_frame_args.h" 10 #include "cc/output/begin_frame_args.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 base::MakeUnique<TextureMailboxDeleter>(task_runner))); 49 base::MakeUnique<TextureMailboxDeleter>(task_runner)));
50 50
51 capabilities_.delegated_rendering = true; 51 capabilities_.delegated_rendering = true;
52 // Since this OutputSurface and the Display are tightly coupled and in the 52 // Since this OutputSurface and the Display are tightly coupled and in the
53 // same process/thread, the LayerTreeHostImpl can reclaim resources from 53 // same process/thread, the LayerTreeHostImpl can reclaim resources from
54 // the Display. 54 // the Display.
55 capabilities_.can_force_reclaim_resources = true; 55 capabilities_.can_force_reclaim_resources = true;
56 capabilities_.delegated_sync_points_required = 56 capabilities_.delegated_sync_points_required =
57 !context_shared_with_compositor; 57 !context_shared_with_compositor;
58 58
59 surface_id_allocator_->RegisterSurfaceClientId(surface_manager_.get()); 59 surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id());
60 } 60 }
61 61
62 TestDelegatingOutputSurface::~TestDelegatingOutputSurface() {} 62 TestDelegatingOutputSurface::~TestDelegatingOutputSurface() {
63 if (surface_manager_)
piman 2016/07/21 21:02:22 nit: {}
Fady Samuel 2016/07/21 21:21:03 actually TestDelegatingOuptutSurface owns SurfaceM
64 surface_manager_->InvalidateSurfaceClientId(
65 surface_id_allocator_->client_id());
66 }
63 67
64 bool TestDelegatingOutputSurface::BindToClient(OutputSurfaceClient* client) { 68 bool TestDelegatingOutputSurface::BindToClient(OutputSurfaceClient* client) {
65 if (!OutputSurface::BindToClient(client)) 69 if (!OutputSurface::BindToClient(client))
66 return false; 70 return false;
67 71
68 // We want the Display's output surface to hear about lost context, and since 72 // We want the Display's output surface to hear about lost context, and since
69 // this shares a context with it (when delegated_sync_points_required is 73 // this shares a context with it (when delegated_sync_points_required is
70 // false), we should not be listening for lost context callbacks on the 74 // false), we should not be listening for lost context callbacks on the
71 // context here. 75 // context here.
72 if (!capabilities_.delegated_sync_points_required && context_provider()) 76 if (!capabilities_.delegated_sync_points_required && context_provider())
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 void TestDelegatingOutputSurface::DisplayOutputSurfaceLost() { 159 void TestDelegatingOutputSurface::DisplayOutputSurfaceLost() {
156 DidLoseOutputSurface(); 160 DidLoseOutputSurface();
157 } 161 }
158 162
159 void TestDelegatingOutputSurface::DisplaySetMemoryPolicy( 163 void TestDelegatingOutputSurface::DisplaySetMemoryPolicy(
160 const ManagedMemoryPolicy& policy) { 164 const ManagedMemoryPolicy& policy) {
161 SetMemoryPolicy(policy); 165 SetMemoryPolicy(policy);
162 } 166 }
163 167
164 } // namespace cc 168 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_id_allocator.cc ('k') | components/exo/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698