OLD | NEW |
| 1 /* |
| 2 * Copyright 2014 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
1 #include "Test.h" | 8 #include "Test.h" |
2 | 9 |
3 #include "SkRecord.h" | 10 #include "SkRecord.h" |
4 #include "SkRecords.h" | 11 #include "SkRecords.h" |
5 | 12 |
6 // Sums the area of any DrawRect command it sees. | 13 // Sums the area of any DrawRect command it sees. |
7 class AreaSummer { | 14 class AreaSummer { |
8 public: | 15 public: |
9 AreaSummer() : fArea(0) {} | 16 AreaSummer() : fArea(0) {} |
10 | 17 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 REPORTER_ASSERT(r, summer.area() == 100); | 50 REPORTER_ASSERT(r, summer.area() == 100); |
44 | 51 |
45 // Scale 2x. | 52 // Scale 2x. |
46 Stretch stretch; | 53 Stretch stretch; |
47 record.mutate(stretch); | 54 record.mutate(stretch); |
48 | 55 |
49 // Now its area should be 100 + 400. | 56 // Now its area should be 100 + 400. |
50 record.visit(summer); | 57 record.visit(summer); |
51 REPORTER_ASSERT(r, summer.area() == 500); | 58 REPORTER_ASSERT(r, summer.area() == 500); |
52 } | 59 } |
OLD | NEW |