| Index: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
|
| diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
|
| index d2dfc7e4d1f51a056f33e4b19e32b428bdb8f981..f3d56a8dad469c999b944620116a70d26dea520c 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
|
| +++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
|
| @@ -126,6 +126,21 @@ public:
|
| void setLoggerForTesting(PassOwnPtr<Logger>);
|
|
|
| private:
|
| + struct MailboxInfo {
|
| + DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
|
| + WebExternalTextureMailbox m_mailbox;
|
| + RefPtr<SkImage> m_image;
|
| + RefPtr<Canvas2DLayerBridge> m_parentLayerBridge;
|
| +
|
| + // If this mailbox wraps an IOSurface-backed texture, the ids of the
|
| + // CHROMIUM image and the texture.
|
| + GLuint m_CHROMIUMImageId = 0;
|
| + GLuint m_textureId = 0;
|
| +
|
| + MailboxInfo(const MailboxInfo&);
|
| + MailboxInfo() {}
|
| + };
|
| +
|
| Canvas2DLayerBridge(PassOwnPtr<WebGraphicsContext3DProvider>, const IntSize&, int msaaSampleCount, OpacityMode, AccelerationMode);
|
| WebGraphicsContext3D* context();
|
| void startRecording();
|
| @@ -141,6 +156,30 @@ private:
|
| SkSurface* getOrCreateSurface(AccelerationHint = PreferAcceleration);
|
| bool shouldAccelerate(AccelerationHint) const;
|
|
|
| + // Returns the GL filter associated with |m_filterQuality|.
|
| + GLenum getGLFilter();
|
| +
|
| + // Creates an IOSurface-backed texture. Copies |image| into the texture.
|
| + // Prepares a mailbox from the texture. Stores all information in a newly
|
| + // created MailboxInfo, which resides in |m_mailboxes|. Returns whether the
|
| + // mailbox was successfully prepared. |mailbox| is an out parameter only
|
| + // populated on success.
|
| + bool prepareIOSurfaceMailboxFromImage(RefPtr<SkImage>&, WebExternalTextureMailbox*);
|
| +
|
| + // Creates an IOSurface-backed texture. Returns whether the texture ewas
|
| + // successfully created. |texture| and |imageId| are out parameters. The
|
| + // caller takes ownership of both the texture and the image.
|
| + bool createIOSurfaceBackedTexture(GLuint* texture, GLuint* imageId);
|
| +
|
| + // Prepends a new MailboxInfo object to |m_mailboxes|, and returns a
|
| + // reference. The reference is no longer valid after |m_mailboxes| is
|
| + // mutated.
|
| + MailboxInfo& createMailboxInfo();
|
| +
|
| + // Returns whether the mailbox was successfully prepared from the SkImage.
|
| + // The mailbox is an out parameter only populated on success.
|
| + bool prepareMailboxFromImage(RefPtr<SkImage>&, WebExternalTextureMailbox*);
|
| +
|
| OwnPtr<SkPictureRecorder> m_recorder;
|
| RefPtr<SkSurface> m_surface;
|
| RefPtr<SkImage> m_hibernationImage;
|
| @@ -166,16 +205,6 @@ private:
|
|
|
| friend class Canvas2DLayerBridgeTest;
|
|
|
| - struct MailboxInfo {
|
| - DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
|
| - WebExternalTextureMailbox m_mailbox;
|
| - RefPtr<SkImage> m_image;
|
| - RefPtr<Canvas2DLayerBridge> m_parentLayerBridge;
|
| -
|
| - MailboxInfo(const MailboxInfo&);
|
| - MailboxInfo() {}
|
| - };
|
| -
|
| uint32_t m_lastImageId;
|
|
|
| enum {
|
|
|