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

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

Issue 2261623002: Make DrawingBuffer and Canvas2DLayerBridge be cc::TextureLayerClients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: webmailbox: fix-passrefptr 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/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 56652f1ee590e9df2da3c4e89546ea282b96c0bb..797e6a8c23b2ab949fbef79fb7e42a9655e06886 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.h
@@ -26,12 +26,12 @@
#ifndef Canvas2DLayerBridge_h
#define Canvas2DLayerBridge_h
+#include "cc/layers/texture_layer_client.h"
+#include "cc/resources/texture_mailbox.h"
#include "platform/PlatformExport.h"
#include "platform/geometry/IntSize.h"
#include "platform/graphics/ImageBufferSurface.h"
#include "public/platform/WebExternalTextureLayer.h"
-#include "public/platform/WebExternalTextureLayerClient.h"
-#include "public/platform/WebExternalTextureMailbox.h"
#include "public/platform/WebThread.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/skia/include/core/SkSurface.h"
@@ -76,7 +76,7 @@ class SharedContextRateLimiter;
// TODO: Fix background rendering and remove this workaround. crbug.com/600386
#define CANVAS2D_BACKGROUND_RENDER_SWITCH_TO_CPU 0
-class PLATFORM_EXPORT Canvas2DLayerBridge : public WebExternalTextureLayerClient, public WebThread::TaskObserver, public RefCounted<Canvas2DLayerBridge> {
+class PLATFORM_EXPORT Canvas2DLayerBridge : public NON_EXPORTED_BASE(cc::TextureLayerClient), public WebThread::TaskObserver, public RefCounted<Canvas2DLayerBridge> {
WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge);
public:
enum AccelerationMode {
@@ -89,9 +89,15 @@ public:
~Canvas2DLayerBridge() override;
- // WebExternalTextureLayerClient implementation.
- bool prepareMailbox(WebExternalTextureMailbox*, WebExternalBitmap*) override;
- void mailboxReleased(const WebExternalTextureMailbox&, bool lostResource) override;
+ // cc::TextureLayerClient implementation.
+ bool PrepareTextureMailbox(
+ cc::TextureMailbox* outMailbox,
+ std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback,
+ bool useSharedMemory) override;
+
+ // Callback for mailboxes given to the compositor from PrepareTextureMailbox.
+ void mailboxReleased(const gpu::Mailbox&, const gpu::SyncToken&,
+ bool lostResource);
// ImageBufferSurface implementation
void finalizeFrame(const FloatRect &dirtyRect);
@@ -169,7 +175,7 @@ private:
struct MailboxInfo {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
- WebExternalTextureMailbox m_mailbox;
+ gpu::Mailbox m_mailbox;
RefPtr<SkImage> m_image;
RefPtr<Canvas2DLayerBridge> m_parentLayerBridge;
@@ -180,7 +186,7 @@ private:
#endif // USE_IOSURFACE_FOR_2D_CANVAS
MailboxInfo(const MailboxInfo&);
- MailboxInfo() {}
+ MailboxInfo();
};
Canvas2DLayerBridge(std::unique_ptr<WebGraphicsContext3DProvider>, const IntSize&, int msaaSampleCount, OpacityMode, AccelerationMode);
@@ -207,7 +213,7 @@ private:
// MailboxInfo, and prepended it to |m_mailboxs|. Returns whether the
// mailbox was successfully prepared. |mailbox| is an out parameter only
// populated on success.
- bool prepareIOSurfaceMailboxFromImage(SkImage*, WebExternalTextureMailbox*);
+ bool prepareIOSurfaceMailboxFromImage(SkImage*, cc::TextureMailbox*);
// Creates an IOSurface-backed texture. Returns an ImageInfo, which is empty
// on failure. The caller takes ownership of both the texture and the image.
@@ -225,7 +231,7 @@ private:
// Returns whether the mailbox was successfully prepared from the SkImage.
// The mailbox is an out parameter only populated on success.
- bool prepareMailboxFromImage(PassRefPtr<SkImage>, WebExternalTextureMailbox*);
+ bool prepareMailboxFromImage(PassRefPtr<SkImage>, cc::TextureMailbox*);
// Resets Skia's texture bindings. This method should be called after
// changing texture bindings.

Powered by Google App Engine
This is Rietveld 408576698