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

Unified Diff: cc/playback/raster_source_unittest.cc

Issue 2678903003: cc: Clean up naming of paint-related identifiers (Closed)
Patch Set: Created 3 years, 10 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/playback/raster_source_unittest.cc
diff --git a/cc/playback/raster_source_unittest.cc b/cc/playback/raster_source_unittest.cc
index 4467f2446be5f6c74b32e45987233e6b14f10a5b..a0e0ab8ef4e0383e2cbb98f00a41143a6abf07b7 100644
--- a/cc/playback/raster_source_unittest.cc
+++ b/cc/playback/raster_source_unittest.cc
@@ -27,18 +27,18 @@ TEST(RasterSourceTest, AnalyzeIsSolidUnscaled) {
std::unique_ptr<FakeRecordingSource> recording_source =
FakeRecordingSource::CreateFilledRecordingSource(layer_bounds);
- SkPaint solid_paint;
+ PaintFlags solid_flags;
SkColor solid_color = SkColorSetARGB(255, 12, 23, 34);
- solid_paint.setColor(solid_color);
+ solid_flags.setColor(solid_color);
SkColor non_solid_color = SkColorSetARGB(128, 45, 56, 67);
SkColor color = SK_ColorTRANSPARENT;
- SkPaint non_solid_paint;
+ PaintFlags non_solid_flags;
bool is_solid_color = false;
- non_solid_paint.setColor(non_solid_color);
+ non_solid_flags.setColor(non_solid_color);
- recording_source->add_draw_rect_with_paint(gfx::Rect(layer_bounds),
- solid_paint);
+ recording_source->add_draw_rect_with_flags(gfx::Rect(layer_bounds),
+ solid_flags);
recording_source->Rerecord();
scoped_refptr<RasterSource> raster =
@@ -55,8 +55,8 @@ TEST(RasterSourceTest, AnalyzeIsSolidUnscaled) {
}
// Add one non-solid pixel and recreate the raster source.
- recording_source->add_draw_rect_with_paint(gfx::Rect(50, 50, 1, 1),
- non_solid_paint);
+ recording_source->add_draw_rect_with_flags(gfx::Rect(50, 50, 1, 1),
+ non_solid_flags);
recording_source->Rerecord();
raster =
RasterSource::CreateFromRecordingSource(recording_source.get(), false);
@@ -100,16 +100,16 @@ TEST(RasterSourceTest, AnalyzeIsSolidScaled) {
SkColor solid_color = SkColorSetARGB(255, 12, 23, 34);
SkColor color = SK_ColorTRANSPARENT;
- SkPaint solid_paint;
+ PaintFlags solid_flags;
bool is_solid_color = false;
- solid_paint.setColor(solid_color);
+ solid_flags.setColor(solid_color);
SkColor non_solid_color = SkColorSetARGB(128, 45, 56, 67);
- SkPaint non_solid_paint;
- non_solid_paint.setColor(non_solid_color);
+ PaintFlags non_solid_flags;
+ non_solid_flags.setColor(non_solid_color);
- recording_source->add_draw_rect_with_paint(gfx::Rect(0, 0, 400, 400),
- solid_paint);
+ recording_source->add_draw_rect_with_flags(gfx::Rect(0, 0, 400, 400),
+ solid_flags);
recording_source->Rerecord();
scoped_refptr<RasterSource> raster =
@@ -126,8 +126,8 @@ TEST(RasterSourceTest, AnalyzeIsSolidScaled) {
}
// Add one non-solid pixel and recreate the raster source.
- recording_source->add_draw_rect_with_paint(gfx::Rect(50, 50, 1, 1),
- non_solid_paint);
+ recording_source->add_draw_rect_with_flags(gfx::Rect(50, 50, 1, 1),
+ non_solid_flags);
recording_source->Rerecord();
raster =
RasterSource::CreateFromRecordingSource(recording_source.get(), false);
@@ -253,10 +253,10 @@ TEST(RasterSourceTest, RasterFullContents) {
// Because the caller sets content opaque, it also promises that it
// has at least filled in layer_bounds opaquely.
- SkPaint white_paint;
- white_paint.setColor(SK_ColorWHITE);
- recording_source->add_draw_rect_with_paint(gfx::Rect(layer_bounds),
- white_paint);
+ PaintFlags white_flags;
+ white_flags.setColor(SK_ColorWHITE);
+ recording_source->add_draw_rect_with_flags(gfx::Rect(layer_bounds),
+ white_flags);
recording_source->Rerecord();
scoped_refptr<RasterSource> raster =
@@ -318,10 +318,10 @@ TEST(RasterSourceTest, RasterPartialContents) {
recording_source->SetClearCanvasWithDebugColor(false);
// First record everything as white.
- SkPaint white_paint;
- white_paint.setColor(SK_ColorWHITE);
- recording_source->add_draw_rect_with_paint(gfx::Rect(layer_bounds),
- white_paint);
+ PaintFlags white_flags;
+ white_flags.setColor(SK_ColorWHITE);
+ recording_source->add_draw_rect_with_flags(gfx::Rect(layer_bounds),
+ white_flags);
recording_source->Rerecord();
scoped_refptr<RasterSource> raster =
@@ -356,10 +356,10 @@ TEST(RasterSourceTest, RasterPartialContents) {
}
// Re-record everything as black.
- SkPaint black_paint;
- black_paint.setColor(SK_ColorBLACK);
- recording_source->add_draw_rect_with_paint(gfx::Rect(layer_bounds),
- black_paint);
+ PaintFlags black_flags;
+ black_flags.setColor(SK_ColorBLACK);
+ recording_source->add_draw_rect_with_flags(gfx::Rect(layer_bounds),
+ black_flags);
recording_source->Rerecord();
// Make a new RasterSource from the new recording.
@@ -412,11 +412,11 @@ TEST(RasterSourceTest, RasterPartialClear) {
// First record everything as white.
const unsigned alpha_dark = 10u;
- SkPaint white_paint;
- white_paint.setColor(SK_ColorWHITE);
- white_paint.setAlpha(alpha_dark);
- recording_source->add_draw_rect_with_paint(gfx::Rect(layer_bounds),
- white_paint);
+ PaintFlags white_flags;
+ white_flags.setColor(SK_ColorWHITE);
+ white_flags.setAlpha(alpha_dark);
+ recording_source->add_draw_rect_with_flags(gfx::Rect(layer_bounds),
+ white_flags);
recording_source->Rerecord();
scoped_refptr<RasterSource> raster =
@@ -458,9 +458,9 @@ TEST(RasterSourceTest, RasterPartialClear) {
// Record everything as a slightly lighter white.
const unsigned alpha_light = 18u;
- white_paint.setAlpha(alpha_light);
- recording_source_light->add_draw_rect_with_paint(gfx::Rect(layer_bounds),
- white_paint);
+ white_flags.setAlpha(alpha_light);
+ recording_source_light->add_draw_rect_with_flags(gfx::Rect(layer_bounds),
+ white_flags);
recording_source_light->Rerecord();
// Make a new RasterSource from the new recording.
@@ -532,7 +532,7 @@ TEST(RasterSourceTest, GetPictureMemoryUsageIncludesClientReportedMemory) {
scoped_refptr<RasterSource> raster =
RasterSource::CreateFromRecordingSource(recording_source.get(), false);
- size_t total_memory_usage = raster->GetPictureMemoryUsage();
+ size_t total_memory_usage = raster->GetMemoryUsage();
EXPECT_GE(total_memory_usage, kReportedMemoryUsageInBytes);
EXPECT_LT(total_memory_usage, 2 * kReportedMemoryUsageInBytes);
}
@@ -552,19 +552,19 @@ TEST(RasterSourceTest, ImageHijackCanvasRespectsSharedCanvasTransform) {
gfx::Point(0, 0));
// 2. Cover everything in red.
- SkPaint paint;
- paint.setColor(SK_ColorRED);
- recording_source->add_draw_rect_with_paint(gfx::Rect(size), paint);
+ PaintFlags flags;
+ flags.setColor(SK_ColorRED);
+ recording_source->add_draw_rect_with_flags(gfx::Rect(size), flags);
// 3. Draw 4x4 green rects into every corner.
- paint.setColor(SK_ColorGREEN);
- recording_source->add_draw_rect_with_paint(gfx::Rect(0, 0, 4, 4), paint);
- recording_source->add_draw_rect_with_paint(
- gfx::Rect(size.width() - 4, 0, 4, 4), paint);
- recording_source->add_draw_rect_with_paint(
- gfx::Rect(0, size.height() - 4, 4, 4), paint);
- recording_source->add_draw_rect_with_paint(
- gfx::Rect(size.width() - 4, size.height() - 4, 4, 4), paint);
+ flags.setColor(SK_ColorGREEN);
+ recording_source->add_draw_rect_with_flags(gfx::Rect(0, 0, 4, 4), flags);
+ recording_source->add_draw_rect_with_flags(
+ gfx::Rect(size.width() - 4, 0, 4, 4), flags);
+ recording_source->add_draw_rect_with_flags(
+ gfx::Rect(0, size.height() - 4, 4, 4), flags);
+ recording_source->add_draw_rect_with_flags(
+ gfx::Rect(size.width() - 4, size.height() - 4, 4, 4), flags);
recording_source->SetGenerateDiscardableImagesMetadata(true);
recording_source->Rerecord();

Powered by Google App Engine
This is Rietveld 408576698