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

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

Issue 2521013003: Compositing Layer update for OffscreenCanvas resize (Closed)
Patch Set: test Created 4 years, 1 month 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 29679540fa365f8c20961cffd571b7762c55ddf2..e342fa5974bd414ecb993d5ffe43160c643eee77 100644
--- a/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
+++ b/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
@@ -33,7 +33,9 @@ void OffscreenCanvasSurfaceImpl::Create(
std::move(request));
}
-void OffscreenCanvasSurfaceImpl::GetSurfaceId(GetSurfaceIdCallback callback) {
+void OffscreenCanvasSurfaceImpl::GetSurfaceId(
+ blink::mojom::OffscreenCanvasSurfaceClientPtr client,
+ GetSurfaceIdCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (frame_sink_id_.is_valid()) {
// This IPC should be only called once for each HTMLCanvasElement. In this
@@ -48,9 +50,10 @@ void OffscreenCanvasSurfaceImpl::GetSurfaceId(GetSurfaceIdCallback callback) {
"OffscreenCanvasSurfaceManager twice.");
}
+ client_ = std::move(client);
frame_sink_id_ = AllocateFrameSinkId();
cc::SurfaceId surface_id =
- cc::SurfaceId(frame_sink_id_, id_allocator_->GenerateId());
+ cc::SurfaceId(frame_sink_id_, GenerateLocalFrameId());
OffscreenCanvasSurfaceManager::GetInstance()
->RegisterOffscreenCanvasSurfaceInstance(frame_sink_id_, this);
@@ -76,4 +79,11 @@ void OffscreenCanvasSurfaceImpl::Satisfy(const cc::SurfaceSequence& sequence) {
manager->DidSatisfySequences(sequence.frame_sink_id, &sequences);
}
+void OffscreenCanvasSurfaceImpl::OnSurfaceSizeChanged(
+ const cc::SurfaceId& surface_id,
+ gfx::Size new_surface_size) {
+ client_->OnSurfaceSizeChanged(surface_id, new_surface_size.width(),
+ new_surface_size.height());
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698