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

Unified Diff: Source/platform/graphics/StaticBitmapPattern.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/StaticBitmapPattern.h
diff --git a/LICENSE b/Source/platform/graphics/StaticBitmapPattern.h
similarity index 72%
copy from LICENSE
copy to Source/platform/graphics/StaticBitmapPattern.h
index 70bcb8ad118978579fa055f7ecc99604930900ce..e38294a916bfcc5826d29d793c24e7ee6109390b 100644
--- a/LICENSE
+++ b/Source/platform/graphics/StaticBitmapPattern.h
@@ -28,3 +28,31 @@
// 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 StaticBitmapPattern_h
+#define StaticBitmapPattern_h
+
+#include "platform/graphics/Pattern.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT StaticBitmapPattern : public Pattern {
Justin Novosad 2014/07/29 14:56:54 Why export?
Rémi Piotaix 2014/07/29 17:18:23 Done.
+public:
+ static PassRefPtr<Pattern> create(PassRefPtr<Image> tileImage, bool repeatX, bool repeatY)
+ {
+ return adoptRef(new StaticBitmapPattern(tileImage->image(), repeatX, repeatY));
+ }
+
+ virtual ~StaticBitmapPattern() { }
+
+ virtual PassRefPtr<SkShader> createShader() OVERRIDE;
+
+private:
+ StaticBitmapPattern(PassRefPtr<SkImage>, bool repeatX, bool repeatY);
+
+ RefPtr<SkImage> m_tileImage;
+};
+
+} // namespace
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698