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

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

Issue 2300633004: Allow canvases to be GPU-accelerated in Workers (Closed)
Patch Set: Created 4 years, 4 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 202212cc1ffdb1fc6624314e2f76e6b1c5b9c310..4ecbc3041d96ff0b88a92f9f4dacfcd55afc1308 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
@@ -83,8 +83,6 @@ bool OffscreenCanvasRenderingContext2D::hasImageBuffer() const
static bool shouldAccelerate(IntSize surfaceSize)
{
- if (!isMainThread())
- return false; // Add support on Workers crbug.com/
return RuntimeEnabledFeatures::accelerated2dCanvasEnabled();
}
@@ -119,7 +117,6 @@ ImageBitmap* OffscreenCanvasRenderingContext2D::transferToImageBitmap(ExceptionS
if (!imageBuffer())
return nullptr;
RefPtr<SkImage> skImage = m_imageBuffer->newSkImageSnapshot(PreferAcceleration, SnapshotReasonTransferToImageBitmap);
- DCHECK(isMainThread() || !skImage->isTextureBacked()); // Acceleration not yet supported in Workers
RefPtr<StaticBitmapImage> image = StaticBitmapImage::create(skImage.release());
image->setOriginClean(this->originClean());
m_imageBuffer.reset(); // "Transfer" means no retained buffer

Powered by Google App Engine
This is Rietveld 408576698