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

Side by Side Diff: content/renderer/android/synchronous_compositor_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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/renderer/android/synchronous_compositor_output_surface.h" 5 #include "content/renderer/android/synchronous_compositor_output_surface.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 surface_manager_(new cc::SurfaceManager), 99 surface_manager_(new cc::SurfaceManager),
100 surface_id_allocator_(new cc::SurfaceIdAllocator(kCompositorClientId)), 100 surface_id_allocator_(new cc::SurfaceIdAllocator(kCompositorClientId)),
101 surface_factory_(new cc::SurfaceFactory(surface_manager_.get(), this)) { 101 surface_factory_(new cc::SurfaceFactory(surface_manager_.get(), this)) {
102 DCHECK(registry_); 102 DCHECK(registry_);
103 DCHECK(sender_); 103 DCHECK(sender_);
104 thread_checker_.DetachFromThread(); 104 thread_checker_.DetachFromThread();
105 capabilities_.adjust_deadline_for_parent = false; 105 capabilities_.adjust_deadline_for_parent = false;
106 capabilities_.delegated_rendering = true; 106 capabilities_.delegated_rendering = true;
107 memory_policy_.priority_cutoff_when_visible = 107 memory_policy_.priority_cutoff_when_visible =
108 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE; 108 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE;
109 surface_id_allocator_->RegisterSurfaceClientId(surface_manager_.get()); 109 surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id());
110 } 110 }
111 111
112 SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {} 112 SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {
113 surface_manager_->InvalidateSurfaceClientId(
114 surface_id_allocator_->client_id());
115 }
113 116
114 void SynchronousCompositorOutputSurface::SetSyncClient( 117 void SynchronousCompositorOutputSurface::SetSyncClient(
115 SynchronousCompositorOutputSurfaceClient* compositor) { 118 SynchronousCompositorOutputSurfaceClient* compositor) {
116 DCHECK(CalledOnValidThread()); 119 DCHECK(CalledOnValidThread());
117 sync_client_ = compositor; 120 sync_client_ = compositor;
118 if (sync_client_) 121 if (sync_client_)
119 Send(new SyncCompositorHostMsg_OutputSurfaceCreated(routing_id_)); 122 Send(new SyncCompositorHostMsg_OutputSurfaceCreated(routing_id_));
120 } 123 }
121 124
122 bool SynchronousCompositorOutputSurface::OnMessageReceived( 125 bool SynchronousCompositorOutputSurface::OnMessageReceived(
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 client_->ReclaimResources(resources); 406 client_->ReclaimResources(resources);
404 } 407 }
405 408
406 void SynchronousCompositorOutputSurface::SetBeginFrameSource( 409 void SynchronousCompositorOutputSurface::SetBeginFrameSource(
407 cc::BeginFrameSource* begin_frame_source) { 410 cc::BeginFrameSource* begin_frame_source) {
408 // Software output is synchronous and doesn't use a BeginFrameSource. 411 // Software output is synchronous and doesn't use a BeginFrameSource.
409 NOTREACHED(); 412 NOTREACHED();
410 } 413 }
411 414
412 } // namespace content 415 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698