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

Side by Side Diff: tests/RecordDrawTest.cpp

Issue 790733003: remove (dumb) canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase after chrome patches have landed 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 | « tests/PathTest.cpp ('k') | tests/RecorderTest.cpp » ('j') | 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 2014 Google Inc. 2 * Copyright 2014 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 #include "Test.h" 8 #include "Test.h"
9 #include "RecordTestUtils.h" 9 #include "RecordTestUtils.h"
10 10
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } 279 }
280 280
281 void resetTestValues() { 281 void resetTestValues() {
282 fDrawImageCalled = fDrawImageRectCalled = false; 282 fDrawImageCalled = fDrawImageRectCalled = false;
283 } 283 }
284 284
285 bool fDrawImageCalled; 285 bool fDrawImageCalled;
286 bool fDrawImageRectCalled; 286 bool fDrawImageRectCalled;
287 }; 287 };
288 288
289 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterPMColor(10, 10)); 289 SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterN32Premul(10, 10));
290 surface->getCanvas()->clear(SK_ColorGREEN); 290 surface->getCanvas()->clear(SK_ColorGREEN);
291 SkAutoTUnref<SkImage> image(surface->newImageSnapshot()); 291 SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
292 292
293 SkCanvasMock canvas(10, 10); 293 SkCanvasMock canvas(10, 10);
294 294
295 { 295 {
296 SkRecord record; 296 SkRecord record;
297 SkRecorder recorder(&record, 10, 10); 297 SkRecorder recorder(&record, 10, 10);
298 recorder.drawImage(image, 0, 0); 298 recorder.drawImage(image, 0, 0);
299 SkRecordDraw(record, &canvas, NULL, NULL, 0, NULL, 0); 299 SkRecordDraw(record, &canvas, NULL, NULL, 0, NULL, 0);
300 } 300 }
301 REPORTER_ASSERT(r, canvas.fDrawImageCalled); 301 REPORTER_ASSERT(r, canvas.fDrawImageCalled);
302 canvas.resetTestValues(); 302 canvas.resetTestValues();
303 303
304 { 304 {
305 SkRecord record; 305 SkRecord record;
306 SkRecorder recorder(&record, 10, 10); 306 SkRecorder recorder(&record, 10, 10);
307 recorder.drawImageRect(image, 0, SkRect::MakeWH(10, 10)); 307 recorder.drawImageRect(image, 0, SkRect::MakeWH(10, 10));
308 SkRecordDraw(record, &canvas, NULL, NULL, 0, NULL, 0); 308 SkRecordDraw(record, &canvas, NULL, NULL, 0, NULL, 0);
309 } 309 }
310 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled); 310 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled);
311 311
312 } 312 }
OLDNEW
« no previous file with comments | « tests/PathTest.cpp ('k') | tests/RecorderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698