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

Unified Diff: Source/platform/graphics/gpu/DrawingBuffer.h

Issue 274833002: Enable WebGL rendering into ImageCHROMIUM, backed by a scanout buffer to enable overlay suppor… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tests Created 6 years, 7 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: Source/platform/graphics/gpu/DrawingBuffer.h
diff --git a/Source/platform/graphics/gpu/DrawingBuffer.h b/Source/platform/graphics/gpu/DrawingBuffer.h
index b8a51abb68908f13cc491b4e8e54be221b18badb..e21765add6dec750e78d46041ac49d19c0193351 100644
--- a/Source/platform/graphics/gpu/DrawingBuffer.h
+++ b/Source/platform/graphics/gpu/DrawingBuffer.h
@@ -156,11 +156,12 @@ protected: // For unittests
bool packedDepthStencilExtensionSupported, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>);
bool initialize(const IntSize&);
+ void setUseImageChromium(bool useImageChromium) { m_useImageChromium = useImageChromium; }
private:
void mailboxReleasedWhileDestructionInProgress(const blink::WebExternalTextureMailbox&);
- unsigned createColorTexture(const IntSize& size = IntSize());
+ unsigned createColorTexture();
// Create the depth/stencil and multisample buffers, if needed.
void createSecondaryBuffers();
bool resizeFramebuffer(const IntSize&);
@@ -204,6 +205,9 @@ private:
// Helper to texImage2D with pixel==0 case: pixels are initialized to 0.
// By default, alignment is 4, the OpenGL default setting.
void texImage2DResourceSafe(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLint alignment = 4);
+ // Allocate buffer storage to be sent to compositor using either texImage2D or CHROMIUM_image based on available support.
+ void allocateTextureMemory(Platform3DObject textureId, const IntSize&);
+ void deleteChromiumImageForTexture(Platform3DObject textureId);
PreserveDrawingBuffer m_preserveDrawingBuffer;
bool m_scissorEnabled;
@@ -262,6 +266,10 @@ private:
Vector<RefPtr<MailboxInfo> > m_textureMailboxes;
// Mailboxes that were released by the compositor can be used again by this DrawingBuffer.
Deque<blink::WebExternalTextureMailbox> m_recycledMailboxQueue;
+ // If we used CHROMIUM_image as the backing storage for our buffers,
+ // we need to know the mapping from texture id to image.
+ HashMap<Platform3DObject, blink::WGC3Duint> m_textureToImageChromiumMap;
+ bool m_useImageChromium;
RefPtr<ContextEvictionManager> m_contextEvictionManager;

Powered by Google App Engine
This is Rietveld 408576698