OLD | NEW |
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 Loading... |
347 | 347 |
348 GrSurfaceDesc desc; | 348 GrSurfaceDesc desc; |
349 desc.fWidth = fCache.cubeDimension(); | 349 desc.fWidth = fCache.cubeDimension(); |
350 desc.fHeight = fCache.cubeDimension() * fCache.cubeDimension(); | 350 desc.fHeight = fCache.cubeDimension() * fCache.cubeDimension(); |
351 desc.fConfig = kRGBA_8888_GrPixelConfig; | 351 desc.fConfig = kRGBA_8888_GrPixelConfig; |
352 | 352 |
353 SkAutoTUnref<GrTexture> textureCube(context->findAndRefCachedTexture(key)); | 353 SkAutoTUnref<GrTexture> textureCube(context->findAndRefCachedTexture(key)); |
354 if (!textureCube) { | 354 if (!textureCube) { |
355 textureCube.reset(context->createTexture(desc, true, fCubeData->data(),
0)); | 355 textureCube.reset(context->createTexture(desc, true, fCubeData->data(),
0)); |
356 if (textureCube) { | 356 if (textureCube) { |
357 SkAssertResult(context->addResourceToCache(key, textureCube)); | 357 context->addResourceToCache(key, textureCube); |
358 } | 358 } |
359 } | 359 } |
360 | 360 |
361 return textureCube ? GrColorCubeEffect::Create(textureCube) : NULL; | 361 return textureCube ? GrColorCubeEffect::Create(textureCube) : NULL; |
362 } | 362 } |
363 #endif | 363 #endif |
OLD | NEW |