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

Side by Side Diff: src/effects/SkColorCubeFilter.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/effects/SkBlurMaskFilter.cpp ('k') | src/gpu/GrContext.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 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "SkColorCubeFilter.h" 8 #include "SkColorCubeFilter.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkOnce.h" 10 #include "SkOnce.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 GrContentKey::Builder builder(&key, kDomain, 2); 347 GrContentKey::Builder builder(&key, kDomain, 2);
348 builder[0] = fUniqueID; 348 builder[0] = fUniqueID;
349 builder[1] = fCache.cubeDimension(); 349 builder[1] = fCache.cubeDimension();
350 builder.finish(); 350 builder.finish();
351 351
352 GrSurfaceDesc desc; 352 GrSurfaceDesc desc;
353 desc.fWidth = fCache.cubeDimension(); 353 desc.fWidth = fCache.cubeDimension();
354 desc.fHeight = fCache.cubeDimension() * fCache.cubeDimension(); 354 desc.fHeight = fCache.cubeDimension() * fCache.cubeDimension();
355 desc.fConfig = kRGBA_8888_GrPixelConfig; 355 desc.fConfig = kRGBA_8888_GrPixelConfig;
356 356
357 SkAutoTUnref<GrTexture> textureCube(context->findAndRefCachedTexture(key)); 357 GrSurface* surface = static_cast<GrSurface*>(context->findAndRefCachedResour ce(key));
358 if (!textureCube) { 358 SkAutoTUnref<GrTexture> textureCube;
359 textureCube.reset(context->createTexture(desc, fCubeData->data(), 0)); 359 if (surface) {
360 if (textureCube) { 360 textureCube.reset(surface->asTexture());
361 SkAssertResult(context->addResourceToCache(key, textureCube)); 361 } else {
362 } 362 textureCube.reset(context->createTexture(NULL, desc, key, fCubeData->dat a(), 0));
363 } 363 }
364 364
365 return textureCube ? GrColorCubeEffect::Create(textureCube) : NULL; 365 return textureCube ? GrColorCubeEffect::Create(textureCube) : NULL;
366 } 366 }
367 #endif 367 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698