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

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

Issue 1866623002: Hook up CSSPaintValue::image to CSS Paint API callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments + rebase. Created 4 years, 8 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: third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h
diff --git a/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h b/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h
new file mode 100644
index 0000000000000000000000000000000000000000..1b7b780712f9920b780777d8c4aa3b637cc01602
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h
@@ -0,0 +1,37 @@
+// 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 PaintGeneratedImage_h
+#define PaintGeneratedImage_h
+
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/GeneratedImage.h"
+#include "wtf/OwnPtr.h"
+
+namespace blink {
+
+class PLATFORM_EXPORT PaintGeneratedImage : public GeneratedImage {
+public:
+ static PassRefPtr<PaintGeneratedImage> create(PassRefPtr<SkPicture> picture, const IntSize& size)
+ {
+ return adoptRef(new PaintGeneratedImage(picture, size));
+ }
+ ~PaintGeneratedImage() override { }
+
+protected:
+ void draw(SkCanvas*, const SkPaint&, const FloatRect&, const FloatRect&, RespectImageOrientationEnum, ImageClampingMode) override;
+ void drawTile(GraphicsContext&, const FloatRect&) final;
+
+ PaintGeneratedImage(PassRefPtr<SkPicture> picture, const IntSize& size)
+ : GeneratedImage(size)
+ , m_picture(picture)
+ {
+ }
+
+ RefPtr<SkPicture> m_picture;
+};
+
+} // namespace blink
+
+#endif // PaintGeneratedImage_h

Powered by Google App Engine
This is Rietveld 408576698