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 |