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

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

Issue 2455983005: Refactor AcceleratedStaticBitmapImage (Closed)
Patch Set: Keep a unique_ptr<WebGraphicsContext3DProvider>, otherwise crashes Created 4 years, 1 month 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/UnacceleratedStaticBitmapImage.h
diff --git a/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.h b/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.h
new file mode 100644
index 0000000000000000000000000000000000000000..dce442b15b4fb284172d8fdd3f9fe5f868744fb0
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.h
@@ -0,0 +1,39 @@
+// 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 UnacceleratedStaticBitmapImage_h
+#define UnacceleratedStaticBitmapImage_h
+
+#include "platform/graphics/StaticBitmapImage.h"
+
+namespace blink {
+
+class PLATFORM_EXPORT UnacceleratedStaticBitmapImage final
+ : public StaticBitmapImage {
+ public:
+ ~UnacceleratedStaticBitmapImage() override;
+ static PassRefPtr<UnacceleratedStaticBitmapImage> create(sk_sp<SkImage>);
+
+ bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override;
+ IntSize size() const override;
+ sk_sp<SkImage> imageForCurrentFrame() override;
+ // In our current design, the SkImage in this class is always *not*
+ // texture-backed.
+ bool isTextureBacked() { return false; }
+
+ void draw(SkCanvas*,
+ const SkPaint&,
+ const FloatRect& dstRect,
+ const FloatRect& srcRect,
+ RespectImageOrientationEnum,
+ ImageClampingMode) override;
+
+ private:
+ UnacceleratedStaticBitmapImage(sk_sp<SkImage>);
+ sk_sp<SkImage> m_image;
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698