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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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/GraphicsContextTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp
index b00e51a496d774936c6def9b72124b0caa352ddb..6ae241fd8fdb593de8f384160fedaa2b27cb0729 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp
@@ -34,7 +34,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkPicture.h"
+#include "skia/ext/cdl_picture.h"
#include "third_party/skia/include/core/SkShader.h"
#include <memory>
@@ -71,7 +71,8 @@ TEST(GraphicsContextTest, pictureRecording) {
SkBitmap bitmap;
bitmap.allocN32Pixels(100, 100);
bitmap.eraseColor(0);
- SkCanvas canvas(bitmap);
+ SkCanvas sk_canvas(bitmap);
+ CdlCanvas canvas(&sk_canvas);
std::unique_ptr<PaintController> paintController = PaintController::create();
GraphicsContext context(*paintController);
@@ -81,7 +82,7 @@ TEST(GraphicsContextTest, pictureRecording) {
context.beginRecording(bounds);
context.fillRect(FloatRect(0, 0, 50, 50), opaque, SkBlendMode::kSrcOver);
- sk_sp<const SkPicture> picture = context.endRecording();
+ sk_sp<const CdlPicture> picture = context.endRecording();
canvas.drawPicture(picture.get());
EXPECT_OPAQUE_PIXELS_ONLY_IN_RECT(bitmap, IntRect(0, 0, 50, 50))
@@ -100,7 +101,8 @@ TEST(GraphicsContextTest, UnboundedDrawsAreClipped) {
SkBitmap bitmap;
bitmap.allocN32Pixels(400, 400);
bitmap.eraseColor(0);
- SkCanvas canvas(bitmap);
+ SkCanvas sk_canvas(bitmap);
+ CdlCanvas canvas(&sk_canvas);
Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
@@ -124,7 +126,7 @@ TEST(GraphicsContextTest, UnboundedDrawsAreClipped) {
// Make the device opaque in 10,10 40x40.
context.fillRect(FloatRect(10, 10, 40, 40), opaque, SkBlendMode::kSrcOver);
- sk_sp<const SkPicture> picture = context.endRecording();
+ sk_sp<const CdlPicture> picture = context.endRecording();
canvas.drawPicture(picture.get());
EXPECT_OPAQUE_PIXELS_ONLY_IN_RECT(bitmap, IntRect(10, 10, 40, 40));
@@ -137,7 +139,7 @@ TEST(GraphicsContextTest, UnboundedDrawsAreClipped) {
Path path;
path.moveTo(FloatPoint(10, 10));
path.addLineTo(FloatPoint(40, 40));
- SkPaint paint;
+ CdlPaint paint;
paint.setColor(alpha.rgb());
paint.setBlendMode(SkBlendMode::kSrcOut);
context.drawPath(path.getSkPath(), paint);

Powered by Google App Engine
This is Rietveld 408576698