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

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

Issue 358893002: Use newImageSnapshot() to get an image from a Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Bitmap caching for Shaders/Patterns from StaticBitmapImage/SkImage Created 6 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: Source/platform/graphics/StaticBitmapImage.h
diff --git a/Source/platform/graphics/StaticBitmapImage.h b/Source/platform/graphics/StaticBitmapImage.h
new file mode 100644
index 0000000000000000000000000000000000000000..b08bedc585f953bed7cadeb0cc19b2f8f336d6ac
--- /dev/null
+++ b/Source/platform/graphics/StaticBitmapImage.h
@@ -0,0 +1,33 @@
+// Copyright 2014 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 StaticBitmapImage_h
+#define StaticBitmapImage_h
+
+#include "platform/graphics/Image.h"
+
+namespace blink {
+
+class StaticBitmapImage : public Image {
+public:
+ virtual ~StaticBitmapImage();
+
+ static PassRefPtr<Image> create(PassRefPtr<SkImage>);
+ virtual void destroyDecodedData(bool destroyAll) { }
+ virtual bool currentFrameKnownToBeOpaque() { return false; }
+ virtual IntSize size() const;
+ virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, blink::WebBlendMode);
+
+
+ PassRefPtr<SkImage> image() OVERRIDE { return m_image; }
+
+protected:
+ StaticBitmapImage(PassRefPtr<SkImage>);
+
+ RefPtr<SkImage> m_image;
+};
+
+} // namespace
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698