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

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 TestDelegatingOutputSurface 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_) {
64 surface_manager_->InvalidateSurfaceClientId(
danakj 2016/07/22 03:02:19 Why is this here and not in DetachOutputSurface wh
Fady Samuel 2016/07/22 12:23:38 It should absolutely be next to UnregisterSurfaceF
65 surface_id_allocator_->client_id());
66 }
67 }
63 68
64 bool TestDelegatingOutputSurface::BindToClient(OutputSurfaceClient* client) { 69 bool TestDelegatingOutputSurface::BindToClient(OutputSurfaceClient* client) {
65 if (!OutputSurface::BindToClient(client)) 70 if (!OutputSurface::BindToClient(client))
66 return false; 71 return false;
67 72
68 // We want the Display's output surface to hear about lost context, and since 73 // 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 74 // 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 75 // false), we should not be listening for lost context callbacks on the
71 // context here. 76 // context here.
72 if (!capabilities_.delegated_sync_points_required && context_provider()) 77 if (!capabilities_.delegated_sync_points_required && context_provider())
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 void TestDelegatingOutputSurface::DisplayOutputSurfaceLost() { 160 void TestDelegatingOutputSurface::DisplayOutputSurfaceLost() {
156 DidLoseOutputSurface(); 161 DidLoseOutputSurface();
157 } 162 }
158 163
159 void TestDelegatingOutputSurface::DisplaySetMemoryPolicy( 164 void TestDelegatingOutputSurface::DisplaySetMemoryPolicy(
160 const ManagedMemoryPolicy& policy) { 165 const ManagedMemoryPolicy& policy) {
161 SetMemoryPolicy(policy); 166 SetMemoryPolicy(policy);
162 } 167 }
163 168
164 } // namespace cc 169 } // 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