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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 2455983005: Refactor AcceleratedStaticBitmapImage (Closed)
Patch Set: Created 4 years, 2 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/platform/graphics/gpu/DrawingBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
index 5cd97e11e7d72a2d607159773593b00894f8c32b..7bcc718bf98c879b98a8cba8a20063132fe4a11d 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -483,20 +483,6 @@ PassRefPtr<StaticBitmapImage> DrawingBuffer::transferToStaticBitmapImage() {
// reference to the backing via our |textureId|.
releaseCallback->Run(gpu::SyncToken(), true /* lostResource */);
- // Store that texture id as the backing for an SkImage.
- GrGLTextureInfo textureInfo;
- textureInfo.fTarget = GL_TEXTURE_2D;
- textureInfo.fID = textureId;
- GrBackendTextureDesc backendTexture;
- backendTexture.fOrigin = kBottomLeft_GrSurfaceOrigin;
- backendTexture.fWidth = m_size.width();
- backendTexture.fHeight = m_size.height();
- backendTexture.fConfig = kSkia8888_GrPixelConfig;
- backendTexture.fTextureHandle =
- skia::GrGLTextureInfoToGrBackendObject(textureInfo);
- sk_sp<SkImage> skImage =
- SkImage::MakeFromAdoptedTexture(grContext, backendTexture);
-
// We reuse the same mailbox name from above since our texture id was consumed
// from it.
const auto& skImageMailbox = textureMailbox.mailbox();
@@ -511,7 +497,7 @@ PassRefPtr<StaticBitmapImage> DrawingBuffer::transferToStaticBitmapImage() {
// ImageBitmapRenderingContext's transferFromImageBitmap, and try to use them
// in DrawingBuffer.
return AcceleratedStaticBitmapImage::createFromWebGLContextImage(
- std::move(skImage), skImageMailbox, skImageSyncToken);
+ skImageMailbox, skImageSyncToken, textureId, m_gl, m_size);
}
DrawingBuffer::ColorBufferParameters

Powered by Google App Engine
This is Rietveld 408576698