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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 GrUniqueKey key; | 111 GrUniqueKey key; |
112 static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain(); | 112 static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain(); |
113 GrUniqueKey::Builder builder(&key, kDomain, 1); | 113 GrUniqueKey::Builder builder(&key, kDomain, 1); |
114 builder[0] = texDesc.fOrigin; | 114 builder[0] = texDesc.fOrigin; |
115 builder.finish(); | 115 builder.finish(); |
116 | 116 |
117 GrTexture* texture = context->findAndRefCachedTexture(key); | 117 GrTexture* texture = context->findAndRefCachedTexture(key); |
118 if (!texture) { | 118 if (!texture) { |
119 texture = context->createTexture(texDesc, true); | 119 texture = context->createTexture(texDesc, true); |
120 if (texture) { | 120 if (texture) { |
121 SkAssertResult(context->addResourceToCache(key, texture));
| 121 context->addResourceToCache(key, texture); |
122 } | 122 } |
123 } | 123 } |
124 return texture ? texture->asRenderTarget() : NULL; | 124 return texture ? texture->asRenderTarget() : NULL; |
125 } | 125 } |
126 | 126 |
127 static void set_random_xpf(GrContext* context, const GrDrawTargetCaps& caps, | 127 static void set_random_xpf(GrContext* context, const GrDrawTargetCaps& caps, |
128 GrPipelineBuilder* pipelineBuilder, SkRandom* random, | 128 GrPipelineBuilder* pipelineBuilder, SkRandom* random, |
129 GrTexture* dummyTextures[]) { | 129 GrTexture* dummyTextures[]) { |
130 SkAutoTUnref<const GrXPFactory> xpf( | 130 SkAutoTUnref<const GrXPFactory> xpf( |
131 GrProcessorTestFactory<GrXPFactory>::CreateStage(random, context, caps,
dummyTextures)); | 131 GrProcessorTestFactory<GrXPFactory>::CreateStage(random, context, caps,
dummyTextures)); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 } | 364 } |
365 #endif | 365 #endif |
366 GrTestTarget target; | 366 GrTestTarget target; |
367 context->getTestTarget(&target); | 367 context->getTestTarget(&target); |
368 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); | 368 REPORTER_ASSERT(reporter, target.target()->programUnitTest(maxStages
)); |
369 } | 369 } |
370 } | 370 } |
371 } | 371 } |
372 | 372 |
373 #endif | 373 #endif |
OLD | NEW |