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

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

Issue 2196963002: Add a new class AcceleratedStaticBitmap : StaticBitmapImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + minor clean up Created 4 years, 5 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/AcceleratedStaticBitmapImage.h
diff --git a/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h b/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h
new file mode 100644
index 0000000000000000000000000000000000000000..b5a418d95f1da386a140a4d4491aef76ca1d339b
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h
@@ -0,0 +1,36 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef AcceleratedStaticBitmapImage_h
+#define AcceleratedStaticBitmapImage_h
+
+#include "platform/graphics/StaticBitmapImage.h"
+#include "public/platform/WebExternalTextureMailbox.h"
+
+namespace blink {
+
+class PLATFORM_EXPORT AcceleratedStaticBitmapImage final : public StaticBitmapImage {
+public:
+ ~AcceleratedStaticBitmapImage() override { };
+
+ IntSize size() const override;
+ PassRefPtr<SkImage> imageForCurrentFrame() override;
+ static PassRefPtr<AcceleratedStaticBitmapImage> create(PassRefPtr<SkImage>);
+ static PassRefPtr<AcceleratedStaticBitmapImage> create(WebExternalTextureMailbox&);
+ void copyToTexture(WebGraphicsContext3DProvider*, GLuint, GLenum, GLenum, bool) override;
+ bool hasMailbox() override { return m_mailbox.textureSize.width != 0 && m_mailbox.textureSize.height != 0; }
+
+private:
+ AcceleratedStaticBitmapImage(PassRefPtr<SkImage>);
+ AcceleratedStaticBitmapImage(WebExternalTextureMailbox&);
+ bool switchStorageToMailbox(WebGraphicsContext3DProvider*);
+ GLuint switchStorageToSkImageForWebGL(WebGraphicsContext3DProvider*);
+ GLuint switchStorageToSkImage(WebGraphicsContext3DProvider*);
+
+ WebExternalTextureMailbox m_mailbox;
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698