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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |