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

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

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: DrawingDisplayItem Created 3 years, 11 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/GraphicsContextTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp
index 2d0a18c17737fe7eb0d90b2673e4079e0998ae2c..f6f5e62b412bd800160d1e7c4d47cee43fc8ef67 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp
@@ -28,13 +28,13 @@
#include "platform/graphics/BitmapImage.h"
#include "platform/graphics/Path.h"
#include "platform/graphics/paint/PaintController.h"
+#include "platform/graphics/paint/PaintRecord.h"
#include "platform/testing/FontTestHelpers.h"
#include "platform/testing/UnitTestHelpers.h"
#include "platform/text/TextRun.h"
#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 "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 bitmapCanvas(bitmap);
+ PaintCanvasPassThrough canvas(&bitmapCanvas);
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 PaintRecord> 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 bitmapCanvas(bitmap);
+ PaintCanvasPassThrough canvas(&bitmapCanvas);
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 PaintRecord> 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;
+ PaintFlags paint;
paint.setColor(alpha.rgb());
paint.setBlendMode(SkBlendMode::kSrcOut);
context.drawPath(path.getSkPath(), paint);

Powered by Google App Engine
This is Rietveld 408576698