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

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

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « skia/config/SkUserConfig.h ('k') | sky/engine/bindings/scripts/blink_idl_parser.py » ('j') | 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 record_canvas->drawRect(SkRect::MakeWH(256, 256), paint); 303 record_canvas->drawRect(SkRect::MakeWH(256, 256), paint);
304 record_canvas->drawRect(SkRect::MakeWH(256, 256), paint); 304 record_canvas->drawRect(SkRect::MakeWH(256, 256), paint);
305 record_canvas->drawText( 305 record_canvas->drawText(
306 text.c_str(), text.length(), point.fX, point.fY, paint); 306 text.c_str(), text.length(), point.fX, point.fY, paint);
307 307
308 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); 308 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
309 309
310 // Draw the picture into the analysis canvas, using the canvas as a callback 310 // Draw the picture into the analysis canvas, using the canvas as a callback
311 // as well. 311 // as well.
312 skia::AnalysisCanvas canvas(256, 256); 312 skia::AnalysisCanvas canvas(256, 256);
313 picture->draw(&canvas, &canvas); 313 picture->playback(&canvas, &canvas);
314 314
315 // Ensure that canvas is not solid. 315 // Ensure that canvas is not solid.
316 SkColor output_color; 316 SkColor output_color;
317 EXPECT_FALSE(canvas.GetColorIfSolid(&output_color)); 317 EXPECT_FALSE(canvas.GetColorIfSolid(&output_color));
318 318
319 // Verify that we aborted drawing. 319 // Verify that we aborted drawing.
320 EXPECT_TRUE(canvas.abortDrawing()); 320 EXPECT_TRUE(canvas.abortDrawing());
321 321
322 } 322 }
323 323
(...skipping 22 matching lines...) Expand all
346 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor)); 346 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor));
347 347
348 canvas.restore(); 348 canvas.restore();
349 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor)); 349 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor));
350 350
351 SolidColorFill(canvas); 351 SolidColorFill(canvas);
352 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor)); 352 EXPECT_FALSE(canvas.GetColorIfSolid(&outputColor));
353 } 353 }
354 354
355 } // namespace skia 355 } // namespace skia
OLDNEW
« no previous file with comments | « skia/config/SkUserConfig.h ('k') | sky/engine/bindings/scripts/blink_idl_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698