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 #if SK_SUPPORT_GPU | 8 #if SK_SUPPORT_GPU |
9 | 9 |
10 #include "Test.h" | 10 #include "Test.h" |
11 | 11 |
12 #include "GrContextFactory.h" | 12 #include "GrContextFactory.h" |
13 #include "GrLayerCache.h" | 13 #include "GrLayerCache.h" |
14 #include "GrRecordReplaceDraw.h" | 14 #include "GrRecordReplaceDraw.h" |
15 #include "RecordTestUtils.h" | 15 #include "RecordTestUtils.h" |
16 #include "SkBBHFactory.h" | 16 #include "SkBBHFactory.h" |
17 #include "SkPictureRecorder.h" | 17 #include "SkPictureRecorder.h" |
18 #include "SkRecordDraw.h" | 18 #include "SkRecordDraw.h" |
19 #include "SkRecorder.h" | 19 #include "SkRecorder.h" |
20 #include "SkUtils.h" | 20 #include "SkUtils.h" |
21 | 21 |
22 static const int kWidth = 100; | 22 static const int kWidth = 100; |
23 static const int kHeight = 100; | 23 static const int kHeight = 100; |
24 | 24 |
25 class JustOneDraw : public SkPicture::AbortCallback { | 25 class JustOneDraw : public SkPicture::AbortCallback { |
26 public: | 26 public: |
27 JustOneDraw() : fCalls(0) {} | 27 JustOneDraw() : fCalls(0) {} |
28 | 28 |
29 bool abort() SK_OVERRIDE { return fCalls++ > 0; } | 29 bool abort() override { return fCalls++ > 0; } |
30 private: | 30 private: |
31 int fCalls; | 31 int fCalls; |
32 }; | 32 }; |
33 | 33 |
34 // Make sure the abort callback works | 34 // Make sure the abort callback works |
35 DEF_TEST(RecordReplaceDraw_Abort, r) { | 35 DEF_TEST(RecordReplaceDraw_Abort, r) { |
36 SkAutoTUnref<const SkPicture> pic; | 36 SkAutoTUnref<const SkPicture> pic; |
37 | 37 |
38 { | 38 { |
39 // Record two commands. | 39 // Record two commands. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 if (NULL == context) { | 158 if (NULL == context) { |
159 continue; | 159 continue; |
160 } | 160 } |
161 | 161 |
162 test_replacements(r, context, true); | 162 test_replacements(r, context, true); |
163 test_replacements(r, context, false); | 163 test_replacements(r, context, false); |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 #endif | 167 #endif |
OLD | NEW |