OLD | NEW |
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 "SkDebugCanvas.h" | 10 #include "SkDebugCanvas.h" |
11 #include "SkRecord.h" | 11 #include "SkRecord.h" |
12 #include "SkRecordCulling.h" | 12 #include "SkRecordOpts.h" |
13 #include "SkRecordDraw.h" | 13 #include "SkRecordDraw.h" |
14 #include "SkRecorder.h" | 14 #include "SkRecorder.h" |
15 #include "SkRecords.h" | 15 #include "SkRecords.h" |
16 | 16 |
17 static const int W = 1920, H = 1080; | 17 static const int W = 1920, H = 1080; |
18 | 18 |
19 DEF_TEST(RecordDraw_Culling, r) { | 19 DEF_TEST(RecordDraw_Culling, r) { |
20 // Record these 7 drawing commands verbatim. | 20 // Record these 7 drawing commands verbatim. |
21 SkRecord record; | 21 SkRecord record; |
22 SkRecorder recorder(SkRecorder::kWriteOnly_Mode, &record, W, H); | 22 SkRecorder recorder(SkRecorder::kWriteOnly_Mode, &record, W, H); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 recorder.restore(); | 63 recorder.restore(); |
64 | 64 |
65 // Same deal as above: we need full SkCanvas semantics for clip skipping to
work. | 65 // Same deal as above: we need full SkCanvas semantics for clip skipping to
work. |
66 SkRecord rerecord; | 66 SkRecord rerecord; |
67 SkRecorder rerecorder(SkRecorder::kReadWrite_Mode, &rerecord, W, H); | 67 SkRecorder rerecorder(SkRecorder::kReadWrite_Mode, &rerecord, W, H); |
68 SkRecordDraw(record, &rerecorder); | 68 SkRecordDraw(record, &rerecorder); |
69 | 69 |
70 // All commands except the two marked // Skipped above will be preserved. | 70 // All commands except the two marked // Skipped above will be preserved. |
71 REPORTER_ASSERT(r, 7 == rerecord.count()); | 71 REPORTER_ASSERT(r, 7 == rerecord.count()); |
72 } | 72 } |
OLD | NEW |