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

Unified Diff: cc/trees/layer_tree_host_pixeltest_masks.cc

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: Clean up comments, fix mac build 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: cc/trees/layer_tree_host_pixeltest_masks.cc
diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc
index 0b2a75a7303d8186b021c94541e9a12bb6a2829c..39ef2f1482b28836cc34041f477aa0bc5d7dccb4 100644
--- a/cc/trees/layer_tree_host_pixeltest_masks.cc
+++ b/cc/trees/layer_tree_host_pixeltest_masks.cc
@@ -9,14 +9,15 @@
#include "cc/layers/picture_image_layer.h"
#include "cc/layers/picture_layer.h"
#include "cc/layers/solid_color_layer.h"
+#include "cc/paint/paint_flags.h"
+#include "cc/paint/paint_recorder.h"
+#include "cc/paint/paint_surface.h"
#include "cc/playback/display_item_list_settings.h"
#include "cc/playback/drawing_display_item.h"
#include "cc/test/layer_tree_pixel_resource_test.h"
#include "cc/test/pixel_comparator.h"
#include "cc/test/solid_color_content_layer_client.h"
#include "third_party/skia/include/core/SkImage.h"
-#include "third_party/skia/include/core/SkPictureRecorder.h"
-#include "third_party/skia/include/core/SkSurface.h"
#if !defined(OS_ANDROID)
@@ -39,12 +40,12 @@ class MaskContentLayerClient : public ContentLayerClient {
scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
PaintingControlSetting picture_control) override {
- SkPictureRecorder recorder;
- SkCanvas* canvas =
+ PaintRecorder recorder;
+ PaintCanvas* canvas =
recorder.beginRecording(gfx::RectToSkRect(gfx::Rect(bounds_)));
- SkPaint paint;
- paint.setStyle(SkPaint::kStroke_Style);
+ PaintFlags paint;
+ paint.setStyle(PaintFlags::kStroke_Style);
paint.setStrokeWidth(SkIntToScalar(2));
paint.setColor(SK_ColorWHITE);
@@ -104,7 +105,7 @@ TEST_P(LayerTreeHostMasksPixelTest, ImageMaskOfLayer) {
mask->SetBounds(mask_bounds);
sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(200, 200);
- SkCanvas* canvas = surface->getCanvas();
+ PaintCanvas* canvas = surface->getCanvas();
danakj 2017/01/20 23:34:14 SkSurface can't return a PaintCanvas
canvas->scale(SkIntToScalar(4), SkIntToScalar(4));
MaskContentLayerClient client(mask_bounds);
scoped_refptr<DisplayItemList> mask_display_list =
@@ -162,12 +163,12 @@ class CheckerContentLayerClient : public ContentLayerClient {
gfx::Rect PaintableRegion() override { return gfx::Rect(bounds_); }
scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
PaintingControlSetting picture_control) override {
- SkPictureRecorder recorder;
- SkCanvas* canvas =
+ PaintRecorder recorder;
+ PaintCanvas* canvas =
recorder.beginRecording(gfx::RectToSkRect(gfx::Rect(bounds_)));
- SkPaint paint;
- paint.setStyle(SkPaint::kStroke_Style);
+ PaintFlags paint;
+ paint.setStyle(PaintFlags::kStroke_Style);
paint.setStrokeWidth(SkIntToScalar(4));
paint.setColor(color_);
canvas->clear(SK_ColorTRANSPARENT);
@@ -206,12 +207,12 @@ class CircleContentLayerClient : public ContentLayerClient {
gfx::Rect PaintableRegion() override { return gfx::Rect(bounds_); }
scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
PaintingControlSetting picture_control) override {
- SkPictureRecorder recorder;
- SkCanvas* canvas =
+ PaintRecorder recorder;
+ PaintCanvas* canvas =
recorder.beginRecording(gfx::RectToSkRect(gfx::Rect(bounds_)));
- SkPaint paint;
- paint.setStyle(SkPaint::kFill_Style);
+ PaintFlags paint;
+ paint.setStyle(PaintFlags::kFill_Style);
paint.setColor(SK_ColorWHITE);
canvas->clear(SK_ColorTRANSPARENT);
canvas->drawCircle(bounds_.width() / 2,

Powered by Google App Engine
This is Rietveld 408576698