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

Side by Side Diff: skia/ext/analysis_canvas_unittest.cc

Issue 1138923005: Remove SK_LEGACY_DRAWPICTURECALLBACK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: analysis_canvas_unittest fix Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « skia/ext/analysis_canvas.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "skia/ext/analysis_canvas.h" 6 #include "skia/ext/analysis_canvas.h"
7 #include "skia/ext/refptr.h" 7 #include "skia/ext/refptr.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "third_party/skia/include/core/SkPicture.h" 9 #include "third_party/skia/include/core/SkPicture.h"
10 #include "third_party/skia/include/core/SkPictureRecorder.h" 10 #include "third_party/skia/include/core/SkPictureRecorder.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 // Draw the picture into the analysis canvas, using the canvas as a callback 351 // Draw the picture into the analysis canvas, using the canvas as a callback
352 // as well. 352 // as well.
353 skia::AnalysisCanvas canvas(256, 256); 353 skia::AnalysisCanvas canvas(256, 256);
354 picture->playback(&canvas, &canvas); 354 picture->playback(&canvas, &canvas);
355 355
356 // Ensure that canvas is not solid. 356 // Ensure that canvas is not solid.
357 SkColor output_color; 357 SkColor output_color;
358 EXPECT_FALSE(canvas.GetColorIfSolid(&output_color)); 358 EXPECT_FALSE(canvas.GetColorIfSolid(&output_color));
359 359
360 // Verify that we aborted drawing. 360 // Verify that we aborted drawing.
361 EXPECT_TRUE(canvas.abortDrawing()); 361 EXPECT_TRUE(canvas.abort());
362 } 362 }
363 363
364 TEST(AnalysisCanvasTest, ClipComplexRegion) { 364 TEST(AnalysisCanvasTest, ClipComplexRegion) {
365 skia::AnalysisCanvas canvas(255, 255); 365 skia::AnalysisCanvas canvas(255, 255);
366 366
367 SkPath path; 367 SkPath path;
368 path.moveTo(0, 0); 368 path.moveTo(0, 0);
369 path.lineTo(128, 50); 369 path.lineTo(128, 50);
370 path.lineTo(255, 0); 370 path.lineTo(255, 0);
371 path.lineTo(255, 255); 371 path.lineTo(255, 255);
(...skipping 14 matching lines...) Expand all
386 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor)); 386 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor));
387 387
388 canvas.restore(); 388 canvas.restore();
389 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor)); 389 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor));
390 390
391 SolidColorFill(canvas); 391 SolidColorFill(canvas);
392 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor)); 392 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor));
393 } 393 }
394 394
395 } // namespace skia 395 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/analysis_canvas.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698