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

Side by Side Diff: src/effects/SkColorCubeFilter.cpp

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Rebasing. Created 4 years, 9 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/GrGpu.h » ('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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 GrUniqueKey key; 303 GrUniqueKey key;
304 GrUniqueKey::Builder builder(&key, kDomain, 2); 304 GrUniqueKey::Builder builder(&key, kDomain, 2);
305 builder[0] = fUniqueID; 305 builder[0] = fUniqueID;
306 builder[1] = fCache.cubeDimension(); 306 builder[1] = fCache.cubeDimension();
307 builder.finish(); 307 builder.finish();
308 308
309 GrSurfaceDesc desc; 309 GrSurfaceDesc desc;
310 desc.fWidth = fCache.cubeDimension(); 310 desc.fWidth = fCache.cubeDimension();
311 desc.fHeight = fCache.cubeDimension() * fCache.cubeDimension(); 311 desc.fHeight = fCache.cubeDimension() * fCache.cubeDimension();
312 desc.fConfig = kRGBA_8888_GrPixelConfig; 312 desc.fConfig = kRGBA_8888_GrPixelConfig;
313 desc.fIsMipMapped = false;
313 314
314 SkAutoTUnref<GrTexture> textureCube( 315 SkAutoTUnref<GrTexture> textureCube(
315 context->textureProvider()->findAndRefTextureByUniqueKey(key)); 316 context->textureProvider()->findAndRefTextureByUniqueKey(key));
316 if (!textureCube) { 317 if (!textureCube) {
317 textureCube.reset(context->textureProvider()->createTexture( 318 textureCube.reset(context->textureProvider()->createTexture(
318 desc, SkBudgeted::kYes, fCubeData->data(), 0)); 319 desc, SkBudgeted::kYes, fCubeData->data(), 0));
319 if (textureCube) { 320 if (textureCube) {
320 context->textureProvider()->assignUniqueKeyToTexture(key, textureCub e); 321 context->textureProvider()->assignUniqueKeyToTexture(key, textureCub e);
321 } else { 322 } else {
322 return nullptr; 323 return nullptr;
323 } 324 }
324 } 325 }
325 326
326 return GrColorCubeEffect::Create(textureCube); 327 return GrColorCubeEffect::Create(textureCube);
327 } 328 }
328 #endif 329 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698