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

Side by Side Diff: tests/RecordDrawTest.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 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 | « tests/ReadPixelsTest.cpp ('k') | tests/RecordOptsTest.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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 } 233 }
234 234
235 // When a saveLayer provides an explicit bound and has a complex paint (e.g., on e that 235 // When a saveLayer provides an explicit bound and has a complex paint (e.g., on e that
236 // affects transparent black), that bound should serve to shrink the area of the required 236 // affects transparent black), that bound should serve to shrink the area of the required
237 // backing store. 237 // backing store.
238 DEF_TEST(RecordDraw_SaveLayerBoundsAffectsClipBounds, r) { 238 DEF_TEST(RecordDraw_SaveLayerBoundsAffectsClipBounds, r) {
239 SkRecord record; 239 SkRecord record;
240 SkRecorder recorder(&record, 50, 50); 240 SkRecorder recorder(&record, 50, 50);
241 241
242 SkPaint p; 242 SkPaint p;
243 p.setXfermodeMode(SkXfermode::kSrc_Mode); 243 p.setBlendMode(SkBlendMode::kSrc);
244 244
245 SkRect layerBounds = SkRect::MakeLTRB(10, 10, 40, 40); 245 SkRect layerBounds = SkRect::MakeLTRB(10, 10, 40, 40);
246 recorder.saveLayer(&layerBounds, &p); 246 recorder.saveLayer(&layerBounds, &p);
247 recorder.drawRect(SkRect::MakeLTRB(20, 20, 30, 30), SkPaint()); 247 recorder.drawRect(SkRect::MakeLTRB(20, 20, 30, 30), SkPaint());
248 recorder.restore(); 248 recorder.restore();
249 249
250 SkAutoTMalloc<SkRect> bounds(record.count()); 250 SkAutoTMalloc<SkRect> bounds(record.count());
251 SkRecordFillBounds(SkRect::MakeWH(50, 50), record, bounds); 251 SkRecordFillBounds(SkRect::MakeWH(50, 50), record, bounds);
252 if (!SkCanvas::Internal_Private_GetIgnoreSaveLayerBounds()) { 252 if (!SkCanvas::Internal_Private_GetIgnoreSaveLayerBounds()) {
253 REPORTER_ASSERT(r, sloppy_rect_eq(bounds[0], SkRect::MakeLTRB(10, 10, 40 , 40))); 253 REPORTER_ASSERT(r, sloppy_rect_eq(bounds[0], SkRect::MakeLTRB(10, 10, 40 , 40)));
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 { 299 {
300 SkRecord record; 300 SkRecord record;
301 SkRecorder recorder(&record, 10, 10); 301 SkRecorder recorder(&record, 10, 10);
302 recorder.drawImageRect(image, SkRect::MakeWH(10, 10), nullptr); 302 recorder.drawImageRect(image, SkRect::MakeWH(10, 10), nullptr);
303 SkRecordDraw(record, &canvas, nullptr, nullptr, 0, nullptr, 0); 303 SkRecordDraw(record, &canvas, nullptr, nullptr, 0, nullptr, 0);
304 } 304 }
305 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled); 305 REPORTER_ASSERT(r, canvas.fDrawImageRectCalled);
306 306
307 } 307 }
OLDNEW
« no previous file with comments | « tests/ReadPixelsTest.cpp ('k') | tests/RecordOptsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698