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

Side by Side Diff: tests/RecordTest.cpp

Issue 272673002: Move paints to the front of draw structs. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 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 | « src/record/SkRecords.h ('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 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 9
10 #include "SkRecord.h" 10 #include "SkRecord.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 }; 49 };
50 50
51 // Basic tests for the low-level SkRecord code. 51 // Basic tests for the low-level SkRecord code.
52 DEF_TEST(Record, r) { 52 DEF_TEST(Record, r) {
53 SkRecord record; 53 SkRecord record;
54 54
55 // Add a simple DrawRect command. 55 // Add a simple DrawRect command.
56 SkRect rect = SkRect::MakeWH(10, 10); 56 SkRect rect = SkRect::MakeWH(10, 10);
57 SkPaint paint; 57 SkPaint paint;
58 SkNEW_PLACEMENT_ARGS(record.append<SkRecords::DrawRect>(), SkRecords::DrawRe ct, (rect, paint)); 58 SkNEW_PLACEMENT_ARGS(record.append<SkRecords::DrawRect>(), SkRecords::DrawRe ct, (paint, rect));
59 59
60 // Its area should be 100. 60 // Its area should be 100.
61 AreaSummer summer; 61 AreaSummer summer;
62 summer.apply(record); 62 summer.apply(record);
63 REPORTER_ASSERT(r, summer.area() == 100); 63 REPORTER_ASSERT(r, summer.area() == 100);
64 64
65 // Scale 2x. 65 // Scale 2x.
66 Stretch stretch; 66 Stretch stretch;
67 stretch.apply(&record); 67 stretch.apply(&record);
68 68
69 // Now its area should be 100 + 400. 69 // Now its area should be 100 + 400.
70 summer.apply(record); 70 summer.apply(record);
71 REPORTER_ASSERT(r, summer.area() == 500); 71 REPORTER_ASSERT(r, summer.area() == 500);
72 } 72 }
OLDNEW
« no previous file with comments | « src/record/SkRecords.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698