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

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

Issue 2588053003: Make OffscreenCanvas resizable (Closed)
Patch Set: rebase Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d32911013a6969b58007c6caa300f8888771d873..61331f8308302508f2389421354e8de745899dbd 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
@@ -36,6 +36,7 @@ OffscreenCanvasFrameDispatcherImpl::OffscreenCanvasFrameDispatcherImpl(
: m_frameSinkId(cc::FrameSinkId(clientId, sinkId)),
m_width(width),
m_height(height),
+ m_changeSizeForNextCommit(false),
m_nextResourceId(1u),
m_binding(this),
m_placeholderCanvasId(canvasId) {
@@ -357,6 +358,10 @@ void OffscreenCanvasFrameDispatcherImpl::dispatchFrame(
NOTREACHED();
}
+ if (m_changeSizeForNextCommit) {
+ m_currentLocalFrameId = m_surfaceIdAllocator.GenerateId();
+ m_changeSizeForNextCommit = false;
+ }
m_sink->SubmitCompositorFrame(m_currentLocalFrameId, std::move(frame));
}
@@ -406,8 +411,11 @@ bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize(
}
void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) {
- m_width = width;
- m_height = height;
+ if (m_width != width || m_height != height) {
+ m_width = width;
+ m_height = height;
+ m_changeSizeForNextCommit = true;
+ }
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698