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

Unified Diff: third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h

Issue 2026803002: Avoid GPU readback in tex(Sub)Image2D(ImageBitmap) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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/StaticBitmapImage.h
diff --git a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
index 001e3b01b93b3145e6792ca8fc9bc93c112ef843..9113bc4ffc5a91a528d64cf54e6d2002853b4158 100644
--- a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
+++ b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
@@ -7,6 +7,7 @@
#include "platform/graphics/Image.h"
#include "public/platform/WebExternalTextureMailbox.h"
+#include "third_party/khronos/GLES2/gl2.h"
namespace blink {
@@ -23,18 +24,29 @@ public:
virtual IntSize size() const;
void draw(SkCanvas*, const SkPaint&, const FloatRect& dstRect, const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) override;
- PassRefPtr<SkImage> imageForCurrentFrame() override;
+ PassRefPtr<SkImage> imageForCurrentFrame(WebGraphicsContext3DProvider* = nullptr) override;
bool originClean() const { return m_isOriginClean; }
void setOriginClean(bool flag) { m_isOriginClean = flag; }
bool isPremultiplied() const { return m_isPremultiplied; }
void setPremultiplied(bool flag) { m_isPremultiplied = flag; }
+ void copyTexture(WebGraphicsContext3DProvider*, GLuint, GLenum, GLenum);
+ bool hasContext3DProvider() const { return !!m_provider; }
Justin Novosad 2016/06/07 15:11:07 !! is not necessary You should only use that when
xidachen 2016/06/07 17:49:54 I am not sure how windows bots will react to this,
+ bool hasSkImage() const { return !!m_image; }
Justin Novosad 2016/06/07 15:11:07 same here
+
protected:
StaticBitmapImage(PassRefPtr<SkImage>);
StaticBitmapImage(WebExternalTextureMailbox&);
+private:
+ void consumeTextureMailbox(WebGraphicsContext3DProvider*);
+ bool prepareMailboxForSkImage(WebGraphicsContext3DProvider*);
+
RefPtr<SkImage> m_image;
WebExternalTextureMailbox m_mailbox;
+ OwnPtr<WebGraphicsContext3DProvider> m_provider;
+ // Cached textureId from CreateAndConsumeTextureCHROMIUM
+ GLuint m_textureId = 0;
bool m_isOriginClean = true;
// The premultiply info is stored here because the SkImage API
// doesn't expose this info.

Powered by Google App Engine
This is Rietveld 408576698