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

Unified Diff: content/browser/renderer_host/offscreen_canvas_surface_impl.cc

Issue 2333133003: Make Surface creation lazy for OffscreenCanvasFrameReceiverImpl (Closed)
Patch Set: Rebase Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/offscreen_canvas_surface_impl.cc
diff --git a/content/browser/renderer_host/offscreen_canvas_surface_impl.cc b/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
index 7fd14414decfc3f74175ee858f0bd08295c9a53c..a023ca0f8d033e21b290b4f5c2ec74fda989d28d 100644
--- a/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
+++ b/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
@@ -14,21 +14,9 @@
namespace content {
OffscreenCanvasSurfaceImpl::OffscreenCanvasSurfaceImpl()
- : id_allocator_(new cc::SurfaceIdAllocator(AllocateSurfaceClientId())) {
- GetSurfaceManager()->RegisterSurfaceClientId(id_allocator_->client_id());
-}
+ : id_allocator_(new cc::SurfaceIdAllocator(AllocateSurfaceClientId())) {}
-OffscreenCanvasSurfaceImpl::~OffscreenCanvasSurfaceImpl() {
- if (!GetSurfaceManager()) {
- // Inform both members that SurfaceManager's no longer alive to
- // avoid their destruction errors.
- if (surface_factory_)
- surface_factory_->DidDestroySurfaceManager();
- } else {
- GetSurfaceManager()->InvalidateSurfaceClientId(id_allocator_->client_id());
- }
- surface_factory_->Destroy(surface_id_);
-}
+OffscreenCanvasSurfaceImpl::~OffscreenCanvasSurfaceImpl() {}
// static
void OffscreenCanvasSurfaceImpl::Create(
@@ -46,15 +34,6 @@ void OffscreenCanvasSurfaceImpl::GetSurfaceId(
callback.Run(surface_id_);
}
-void OffscreenCanvasSurfaceImpl::RequestSurfaceCreation(
- const cc::SurfaceId& surface_id) {
- cc::SurfaceManager* manager = GetSurfaceManager();
- if (!surface_factory_) {
- surface_factory_ = base::MakeUnique<cc::SurfaceFactory>(manager, this);
- }
- surface_factory_->Create(surface_id);
-}
-
void OffscreenCanvasSurfaceImpl::Require(const cc::SurfaceId& surface_id,
const cc::SurfaceSequence& sequence) {
cc::SurfaceManager* manager = GetSurfaceManager();
@@ -73,16 +52,4 @@ void OffscreenCanvasSurfaceImpl::Satisfy(const cc::SurfaceSequence& sequence) {
manager->DidSatisfySequences(sequence.client_id, &sequences);
}
-// TODO(619136): Implement cc::SurfaceFactoryClient functions for resources
-// return.
-void OffscreenCanvasSurfaceImpl::ReturnResources(
- const cc::ReturnedResourceArray& resources) {}
-
-void OffscreenCanvasSurfaceImpl::WillDrawSurface(const cc::SurfaceId& id,
- const gfx::Rect& damage_rect) {
-}
-
-void OffscreenCanvasSurfaceImpl::SetBeginFrameSource(
- cc::BeginFrameSource* begin_frame_source) {}
-
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698