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

Unified Diff: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp

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: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
index c9ae4ea51ed5a5bba2e665270fa785d9440b1d21..ca177a5d5a16bcc96934aee601bcf0e57cd5cb7c 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
@@ -34,15 +34,11 @@ OffscreenCanvasFrameDispatcherImpl::OffscreenCanvasFrameDispatcherImpl(
uint64_t nonceHigh,
uint64_t nonceLow,
int canvasId,
- int width,
- int height)
- : m_surfaceId(
- cc::FrameSinkId(clientId, sinkId),
- cc::LocalFrameId(
- localId,
- base::UnguessableToken::Deserialize(nonceHigh, nonceLow))),
- m_width(width),
- m_height(height),
+ unsigned width,
+ unsigned height)
+ : m_frameSinkId(cc::FrameSinkId(clientId, sinkId)),
+ m_width(clampTo<int>(width)),
+ m_height(clampTo<int>(height)),
m_nextResourceId(1u),
m_binding(this),
m_placeholderCanvasId(canvasId) {
@@ -50,7 +46,12 @@ OffscreenCanvasFrameDispatcherImpl::OffscreenCanvasFrameDispatcherImpl(
mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider;
Platform::current()->interfaceProvider()->getInterface(
mojo::GetProxy(&provider));
- provider->CreateCompositorFrameSink(m_surfaceId,
+ cc::SurfaceId surfaceId(
+ m_frameSinkId,
+ cc::LocalFrameId(
+ localId, base::UnguessableToken::Deserialize(nonceHigh, nonceLow)));
+
+ provider->CreateCompositorFrameSink(surfaceId,
m_binding.CreateInterfacePtrAndBind(),
mojo::GetProxy(&m_sink));
}
@@ -401,4 +402,10 @@ bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize(
return false;
}
+void OffscreenCanvasFrameDispatcherImpl::reshape(unsigned width,
+ unsigned height) {
+ m_width = clampTo<int>(width);
+ m_height = clampTo<int>(height);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698