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

Side by Side Diff: content/browser/renderer_host/offscreen_canvas_surface_impl.cc

Issue 2102123002: Make Satisfy/Require callbacks pass Surface id and sequence by reference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More 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 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 "content/browser/renderer_host/offscreen_canvas_surface_impl.h" 5 #include "content/browser/renderer_host/offscreen_canvas_surface_impl.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "cc/surfaces/surface.h" 8 #include "cc/surfaces/surface.h"
9 #include "cc/surfaces/surface_manager.h" 9 #include "cc/surfaces/surface_manager.h"
10 #include "content/browser/compositor/surface_utils.h" 10 #include "content/browser/compositor/surface_utils.h"
(...skipping 10 matching lines...) Expand all
21 21
22 OffscreenCanvasSurfaceImpl::OffscreenCanvasSurfaceImpl( 22 OffscreenCanvasSurfaceImpl::OffscreenCanvasSurfaceImpl(
23 mojo::InterfaceRequest<blink::mojom::OffscreenCanvasSurface> request) 23 mojo::InterfaceRequest<blink::mojom::OffscreenCanvasSurface> request)
24 : id_allocator_(CreateSurfaceIdAllocator()), 24 : id_allocator_(CreateSurfaceIdAllocator()),
25 binding_(this, std::move(request)) {} 25 binding_(this, std::move(request)) {}
26 26
27 OffscreenCanvasSurfaceImpl::~OffscreenCanvasSurfaceImpl() { 27 OffscreenCanvasSurfaceImpl::~OffscreenCanvasSurfaceImpl() {
28 if (!GetSurfaceManager()) { 28 if (!GetSurfaceManager()) {
29 // Inform both members that SurfaceManager's no longer alive to 29 // Inform both members that SurfaceManager's no longer alive to
30 // avoid their destruction errors. 30 // avoid their destruction errors.
31 surface_factory_->didDestroySurfaceManager(); 31 surface_factory_->did_destroy_surface_manager();
rjkroege 2016/06/28 23:31:55 danakj@'s comment applies here too yes?
32 id_allocator_->didDestroySurfaceManager(); 32 id_allocator_->did_destroy_surface_manager();
33 } 33 }
34 surface_factory_->Destroy(surface_id_); 34 surface_factory_->Destroy(surface_id_);
35 } 35 }
36 36
37 void OffscreenCanvasSurfaceImpl::GetSurfaceId( 37 void OffscreenCanvasSurfaceImpl::GetSurfaceId(
38 const GetSurfaceIdCallback& callback) { 38 const GetSurfaceIdCallback& callback) {
39 DCHECK_CURRENTLY_ON(BrowserThread::UI); 39 DCHECK_CURRENTLY_ON(BrowserThread::UI);
40 40
41 surface_id_ = id_allocator_->GenerateId(); 41 surface_id_ = id_allocator_->GenerateId();
42 42
(...skipping 25 matching lines...) Expand all
68 sequences.push_back(sequence.sequence); 68 sequences.push_back(sequence.sequence);
69 cc::SurfaceManager* manager = GetSurfaceManager(); 69 cc::SurfaceManager* manager = GetSurfaceManager();
70 manager->DidSatisfySequences(sequence.id_namespace, &sequences); 70 manager->DidSatisfySequences(sequence.id_namespace, &sequences);
71 } 71 }
72 72
73 // TODO(619136): Implement cc::SurfaceFactoryClient functions for resources 73 // TODO(619136): Implement cc::SurfaceFactoryClient functions for resources
74 // return. 74 // return.
75 void OffscreenCanvasSurfaceImpl::ReturnResources( 75 void OffscreenCanvasSurfaceImpl::ReturnResources(
76 const cc::ReturnedResourceArray& resources) {} 76 const cc::ReturnedResourceArray& resources) {}
77 77
78 void OffscreenCanvasSurfaceImpl::WillDrawSurface(cc::SurfaceId id, 78 void OffscreenCanvasSurfaceImpl::WillDrawSurface(const cc::SurfaceId& id,
79 const gfx::Rect& damage_rect) { 79 const gfx::Rect& damage_rect) {
80 } 80 }
81 81
82 void OffscreenCanvasSurfaceImpl::SetBeginFrameSource( 82 void OffscreenCanvasSurfaceImpl::SetBeginFrameSource(
83 cc::BeginFrameSource* begin_frame_source) {} 83 cc::BeginFrameSource* begin_frame_source) {}
84 84
85 } // namespace content 85 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698