| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 // This is a GPU-backend specific test. It relies on static intializers to work | 9 // This is a GPU-backend specific test. It relies on static intializers to work |
| 10 | 10 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 // setup clip | 243 // setup clip |
| 244 SkRect screen = SkRect::MakeWH(SkIntToScalar(kRenderTargetWidth), | 244 SkRect screen = SkRect::MakeWH(SkIntToScalar(kRenderTargetWidth), |
| 245 SkIntToScalar(kRenderTargetHeight)); | 245 SkIntToScalar(kRenderTargetHeight)); |
| 246 | 246 |
| 247 SkClipStack stack; | 247 SkClipStack stack; |
| 248 stack.clipDevRect(screen, SkRegion::kReplace_Op, false); | 248 stack.clipDevRect(screen, SkRegion::kReplace_Op, false); |
| 249 | 249 |
| 250 // wrap the SkClipStack in a GrClipData | 250 // wrap the SkClipStack in a GrClipData |
| 251 GrClipData clipData; | 251 GrClipData clipData; |
| 252 clipData.fClipStack = &stack; | 252 clipData.fClipStack.reset(SkRef(&stack)); |
| 253 this->setClip(&clipData); | 253 this->setClip(&clipData); |
| 254 | 254 |
| 255 SkRandom random; | 255 SkRandom random; |
| 256 static const int NUM_TESTS = 512; | 256 static const int NUM_TESTS = 512; |
| 257 for (int t = 0; t < NUM_TESTS;) { | 257 for (int t = 0; t < NUM_TESTS;) { |
| 258 // setup random render target(can fail) | 258 // setup random render target(can fail) |
| 259 SkAutoTUnref<GrRenderTarget> rt(random_render_target(fContext, &random))
; | 259 SkAutoTUnref<GrRenderTarget> rt(random_render_target(fContext, &random))
; |
| 260 if (!rt.get()) { | 260 if (!rt.get()) { |
| 261 SkDebugf("Could not allocate render target"); | 261 SkDebugf("Could not allocate render target"); |
| 262 return false; | 262 return false; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 } | 358 } |
| 359 #endif | 359 #endif |
| 360 GrTestTarget target; | 360 GrTestTarget target; |
| 361 context->getTestTarget(&target); | 361 context->getTestTarget(&target); |
| 362 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 362 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 | 366 |
| 367 #endif | 367 #endif |
| OLD | NEW |