OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 // This is a GR test | 9 // This is a GR test |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 SkRect devStackBounds; | 77 SkRect devStackBounds; |
78 | 78 |
79 stack.getConservativeBounds(0, 0, kXSize, kYSize, | 79 stack.getConservativeBounds(0, 0, kXSize, kYSize, |
80 &devStackBounds, | 80 &devStackBounds, |
81 &isIntersectionOfRects); | 81 &isIntersectionOfRects); |
82 | 82 |
83 // make sure that the SkClipStack is behaving itself | 83 // make sure that the SkClipStack is behaving itself |
84 REPORTER_ASSERT(reporter, screen == devStackBounds); | 84 REPORTER_ASSERT(reporter, screen == devStackBounds); |
85 REPORTER_ASSERT(reporter, isIntersectionOfRects); | 85 REPORTER_ASSERT(reporter, isIntersectionOfRects); |
86 | 86 |
87 // wrap the SkClipStack in a GrClipData | 87 // wrap the SkClipStack in a GrClip |
88 GrClip clipData; | 88 GrClip clipData; |
89 clipData.setClipStack(&stack); | 89 clipData.setClipStack(&stack); |
90 | 90 |
91 SkIRect devGrClipDataBound; | 91 SkIRect devGrClipBound; |
92 clipData.getConservativeBounds(texture, | 92 clipData.getConservativeBounds(texture, |
93 &devGrClipDataBound, | 93 &devGrClipBound, |
94 &isIntersectionOfRects); | 94 &isIntersectionOfRects); |
95 | 95 |
96 // make sure that GrClipData is behaving itself | 96 // make sure that GrClip is behaving itself |
97 REPORTER_ASSERT(reporter, intScreen == devGrClipDataBound); | 97 REPORTER_ASSERT(reporter, intScreen == devGrClipBound); |
98 REPORTER_ASSERT(reporter, isIntersectionOfRects); | 98 REPORTER_ASSERT(reporter, isIntersectionOfRects); |
99 } | 99 } |
100 | 100 |
101 //////////////////////////////////////////////////////////////////////////////// | 101 //////////////////////////////////////////////////////////////////////////////// |
102 // verify that the top state of the stack matches the passed in state | 102 // verify that the top state of the stack matches the passed in state |
103 static void check_state(skiatest::Reporter* reporter, | 103 static void check_state(skiatest::Reporter* reporter, |
104 const GrClipMaskCache& cache, | 104 const GrClipMaskCache& cache, |
105 const SkClipStack& clip, | 105 const SkClipStack& clip, |
106 GrTexture* mask, | 106 GrTexture* mask, |
107 const SkIRect& bound) { | 107 const SkIRect& bound) { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 if (NULL == context) { | 224 if (NULL == context) { |
225 continue; | 225 continue; |
226 } | 226 } |
227 | 227 |
228 test_cache(reporter, context); | 228 test_cache(reporter, context); |
229 test_clip_bounds(reporter, context); | 229 test_clip_bounds(reporter, context); |
230 } | 230 } |
231 } | 231 } |
232 | 232 |
233 #endif | 233 #endif |
OLD | NEW |