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

Unified Diff: third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp

Issue 1928043002: Add drawImage() originClean() getSecurityOrigin() to OffscreenCanvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: drawImage API added to interface listing Created 4 years, 8 months 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/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
index 758318b868cfc03fdff88fcf6e793f1ef12ac287..24633388c8c78a57f59e443671e8e1e91a22faf8 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
@@ -33,17 +33,17 @@ DEFINE_TRACE(OffscreenCanvasRenderingContext2D)
// BaseRenderingContext2D implementation
bool OffscreenCanvasRenderingContext2D::originClean() const
{
- return m_originClean;
+ return getOffscreenCanvas()->originClean();
}
void OffscreenCanvasRenderingContext2D::setOriginTainted()
{
- m_originClean = false;
+ return getOffscreenCanvas()->setOriginTainted();
}
-bool OffscreenCanvasRenderingContext2D::wouldTaintOrigin(CanvasImageSource* source, ScriptState* scriptState)
+bool OffscreenCanvasRenderingContext2D::wouldTaintOrigin(CanvasImageSource* source, ExecutionContext* executionContext)
{
- if (scriptState->getExecutionContext()->isWorkerGlobalScope()) {
+ if (executionContext->isWorkerGlobalScope()) {
// Currently, we only support passing in ImageBitmap as source image in
// drawImage() or createPattern() in a OffscreenCanvas2d in worker.
ASSERT(source->isImageBitmap());
@@ -91,6 +91,7 @@ ImageBitmap* OffscreenCanvasRenderingContext2D::transferToImageBitmap(ExceptionS
// TODO: crbug.com/593514 Add support for GPU rendering
RefPtr<SkImage> skImage = m_imageBuffer->newSkImageSnapshot(PreferNoAcceleration, SnapshotReasonUnknown);
RefPtr<StaticBitmapImage> image = StaticBitmapImage::create(skImage.release());
+ image->setOriginClean(this->originClean());
m_imageBuffer.clear(); // "Transfer" means no retained buffer
return ImageBitmap::create(image.release());
}

Powered by Google App Engine
This is Rietveld 408576698