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

Side by Side Diff: tests/CanvasTest.cpp

Issue 735233003: SkCanvas::clear() should call down to devices even when the clip is empty. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « src/core/SkCanvas.cpp ('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 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 /* Description: 8 /* Description:
9 * This test defines a series of elementatry test steps that perform 9 * This test defines a series of elementatry test steps that perform
10 * a single or a small group of canvas API calls. Each test step is 10 * a single or a small group of canvas API calls. Each test step is
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 788
789 for (int testStep = 0; testStep < testStepArray().count(); testStep++) { 789 for (int testStep = 0; testStep < testStepArray().count(); testStep++) {
790 TestOverrideStateConsistency(reporter, d, testStepArray()[testStep]); 790 TestOverrideStateConsistency(reporter, d, testStepArray()[testStep]);
791 if (testStepArray()[testStep]->enablePdfTesting()) { 791 if (testStepArray()[testStep]->enablePdfTesting()) {
792 TestPdfDevice(reporter, d, testStepArray()[testStep]); 792 TestPdfDevice(reporter, d, testStepArray()[testStep]);
793 } 793 }
794 } 794 }
795 795
796 test_newraster(reporter); 796 test_newraster(reporter);
797 } 797 }
798
799 // Make sure SkCanvas passes clear() calls down to its devices even when they're clipped out.
800 DEF_TEST(Canvas_clear, reporter) {
801 SkBitmap bm;
802 bm.allocN32Pixels(1,1);
803
804 SkCanvas canvas(bm);
805 canvas.clear(SK_ColorRED);
806 REPORTER_ASSERT(reporter, SK_ColorRED == bm.getColor(0,0));
807
808 canvas.clipRect(SkRect::MakeEmpty());
809 canvas.clear(SK_ColorGREEN);
810 REPORTER_ASSERT(reporter, SK_ColorGREEN == bm.getColor(0,0));
811 }
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698