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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2566313002: Make OffscreenCanvas commit() propagate the origin-clean flag. (Closed)
Patch Set: add test 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
Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index b90acddd296bc82cb1aae752286133a96ea39cef..65c4d7ab0e63357aa3f75deeba1c8a86ee762d4d 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -641,6 +641,7 @@ ImageData* HTMLCanvasElement::toImageData(SourceDrawingBuffer sourceBuffer,
if (hasImageBuffer()) {
snapshot = buffer()->newSkImageSnapshot(PreferNoAcceleration, reason);
} else if (placeholderFrame()) {
+ DCHECK(placeholderFrame()->originClean());
// TODO(ccameron): Canvas should produce sRGB images.
// https://crbug.com/672299
snapshot = placeholderFrame()->imageForCurrentFrame(
@@ -782,6 +783,8 @@ bool HTMLCanvasElement::originClean() const {
if (document().settings() &&
document().settings()->disableReadingFromCanvas())
return false;
+ if (placeholderFrame())
+ return placeholderFrame()->originClean();
return m_originClean;
}

Powered by Google App Engine
This is Rietveld 408576698