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

Unified Diff: Source/platform/graphics/ImagePattern.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: Created ImagePattern and StaticBitmapImage Created 6 years, 6 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/ImagePattern.h
diff --git a/Source/platform/graphics/WindRule.h b/Source/platform/graphics/ImagePattern.h
similarity index 64%
copy from Source/platform/graphics/WindRule.h
copy to Source/platform/graphics/ImagePattern.h
index d4f123e813276baf5a09ce32d75c6c6637b060c9..ccbbdd39597be4056848981916067f1b563ba2f9 100644
--- a/Source/platform/graphics/WindRule.h
+++ b/Source/platform/graphics/ImagePattern.h
@@ -1,7 +1,8 @@
/*
- * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved.
- * 2006 Rob Buis <buis@kde.org>
+ * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
* Copyright (C) 2007-2008 Torch Mobile, Inc.
+ * Copyright (C) 2013 Google, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,17 +26,30 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Justin Novosad 2014/07/02 19:04:18 For new files use the license header in src/third_
Rémi Piotaix 2014/07/02 20:21:32 Done.
*/
-#ifndef WindRule_h
-#define WindRule_h
+#ifndef ImagePattern_h
+#define ImagePattern_h
+
+#include "platform/graphics/Pattern.h"
namespace WebCore {
-enum WindRule {
- RULE_NONZERO = 0,
- RULE_EVENODD = 1
-};
+class PLATFORM_EXPORT ImagePattern : public Pattern {
+public:
+ static PassRefPtr<Pattern> create(PassRefPtr<Image> tileImage, bool repeatX, bool repeatY)
+ {
+ return adoptRef(new ImagePattern(tileImage->image(), repeatX, repeatY));
+ }
+
+ virtual ~ImagePattern() { }
-}
+ virtual PassRefPtr<SkShader> createShader() OVERRIDE;
+
+private:
+ ImagePattern(PassRefPtr<SkImage>, bool repeatX, bool repeatY);
+
+ RefPtr<SkImage> m_tileImage;
+};
-#endif // WindRule_h
+} // namespace
+#endif

Powered by Google App Engine
This is Rietveld 408576698