Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 887303002: Revert of Move npot resizing out of GrContext and simplify GrContext texture functions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrTextureStripAtlas.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 texDesc.fFlags = kRenderTarget_GrSurfaceFlag; 107 texDesc.fFlags = kRenderTarget_GrSurfaceFlag;
108 texDesc.fConfig = kRGBA_8888_GrPixelConfig; 108 texDesc.fConfig = kRGBA_8888_GrPixelConfig;
109 texDesc.fOrigin = random->nextBool() == true ? kTopLeft_GrSurfaceOrigin : 109 texDesc.fOrigin = random->nextBool() == true ? kTopLeft_GrSurfaceOrigin :
110 kBottomLeft_GrSurfaceOrigin; 110 kBottomLeft_GrSurfaceOrigin;
111 GrContentKey key; 111 GrContentKey key;
112 static const GrContentKey::Domain kDomain = GrContentKey::GenerateDomain(); 112 static const GrContentKey::Domain kDomain = GrContentKey::GenerateDomain();
113 GrContentKey::Builder builder(&key, kDomain, 1); 113 GrContentKey::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 SkAutoTUnref<GrTexture> texture(context->findAndRefTexture(texDesc, key, &pa rams));
118 if (!texture) { 118 if (!texture) {
119 texture = context->createTexture(texDesc); 119 texture.reset(context->createTexture(&params, texDesc, key, 0, 0));
120 if (texture) { 120 if (!texture) {
121 SkAssertResult(context->addResourceToCache(key, texture)); 121 return NULL;
122 } 122 }
123 } 123 }
124 return texture ? texture->asRenderTarget() : NULL; 124 return SkRef(texture->asRenderTarget());
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));
132 SkASSERT(xpf); 132 SkASSERT(xpf);
133 pipelineBuilder->setXPFactory(xpf.get()); 133 pipelineBuilder->setXPFactory(xpf.get());
134 } 134 }
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « src/gpu/effects/GrTextureStripAtlas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698