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

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: Correcting bugs and use new cache mechanism from SkImage Created 6 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: Source/platform/graphics/StaticBitmapImage.h
diff --git a/LICENSE b/Source/platform/graphics/StaticBitmapImage.h
similarity index 68%
copy from LICENSE
copy to Source/platform/graphics/StaticBitmapImage.h
index 70bcb8ad118978579fa055f7ecc99604930900ce..8767b0e56ed604e5d49c9493b32016a42e8b6512 100644
--- a/LICENSE
+++ b/Source/platform/graphics/StaticBitmapImage.h
@@ -28,3 +28,34 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef StaticBitmapImage_h
+#define StaticBitmapImage_h
+
+#include "SkImage.h"
Justin Novosad 2014/07/29 14:56:52 This can be forward declared.
Rémi Piotaix 2014/07/29 17:18:23 Done.
+
+#include "platform/graphics/Image.h"
+
+namespace WebCore {
Justin Novosad 2014/07/29 14:56:52 WebCore -> blink
Rémi Piotaix 2014/07/29 17:18:23 Done.
+
+class PLATFORM_EXPORT StaticBitmapImage : public Image {
Justin Novosad 2014/07/29 14:56:53 Does this really need to be exported?
Rémi Piotaix 2014/07/29 17:18:23 Done.
+public:
+
+ static PassRefPtr<Image> create(PassRefPtr<SkImage>);
+ virtual void destroyDecodedData(bool destroyAll) { }
+ virtual bool currentFrameKnownToBeOpaque() { return false; }
+ virtual IntSize size() const { return IntSize(m_image->width(), m_image->height()); }
+ virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, blink::WebBlendMode);
+
+
+ PassRefPtr<SkImage> image() OVERRIDE { return m_image; }
Justin Novosad 2014/07/29 14:56:53 move to cpp
Rémi Piotaix 2014/07/29 17:18:23 Seems to work with forward-declaration, no need to
+
+protected:
+ StaticBitmapImage(PassRefPtr<SkImage>);
Justin Novosad 2014/07/29 14:56:53 This class should have a virtual destructor (even
Rémi Piotaix 2014/07/29 17:18:23 Done.
+
+ RefPtr<SkImage> m_image;
+};
+
+}
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698