Index: third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.cpp b/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c26d391a7991b83474cea04a4f329e32ab5fdb42 |
--- /dev/null |
+++ b/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.cpp |
@@ -0,0 +1,28 @@ |
+// 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. |
+ |
+#include "platform/graphics/PaintGeneratedImage.h" |
+ |
+#include "platform/geometry/FloatRect.h" |
+#include "third_party/skia/include/core/SkPicture.h" |
+ |
+namespace blink { |
+ |
+void PaintGeneratedImage::draw(SkCanvas* canvas, const SkPaint& paint, const FloatRect& destRect, const FloatRect& srcRect, RespectImageOrientationEnum, ImageClampingMode) |
+{ |
+ SkAutoCanvasRestore ar(canvas, true); |
+ canvas->clipRect(destRect); |
+ canvas->translate(destRect.x(), destRect.y()); |
+ if (destRect.size() != srcRect.size()) |
+ canvas->scale(destRect.width() / srcRect.width(), destRect.height() / srcRect.height()); |
+ canvas->translate(-srcRect.x(), -srcRect.y()); |
+ canvas->drawPicture(m_picture.get()); |
+} |
+ |
+void PaintGeneratedImage::drawTile(GraphicsContext& context, const FloatRect& srcRect) |
+{ |
+ // TODO(ikilpatrick): implement. |
+} |
+ |
+} // namespace blink |