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

Side by Side Diff: tests/GLProgramsTest.cpp

Issue 940463006: Rename GrContentKey to GrUniqueKey (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments 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') | tests/ResourceCacheTest.cpp » ('j') | 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 static GrRenderTarget* random_render_target(GrContext* context, SkRandom* random ) { 101 static GrRenderTarget* random_render_target(GrContext* context, SkRandom* random ) {
102 // setup render target 102 // setup render target
103 GrTextureParams params; 103 GrTextureParams params;
104 GrSurfaceDesc texDesc; 104 GrSurfaceDesc texDesc;
105 texDesc.fWidth = kRenderTargetWidth; 105 texDesc.fWidth = kRenderTargetWidth;
106 texDesc.fHeight = kRenderTargetHeight; 106 texDesc.fHeight = kRenderTargetHeight;
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 GrUniqueKey key;
112 static const GrContentKey::Domain kDomain = GrContentKey::GenerateDomain(); 112 static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain();
113 GrContentKey::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 SkAssertResult(context->addResourceToCache(key, texture));
122 } 122 }
123 } 123 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « src/gpu/effects/GrTextureStripAtlas.cpp ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698