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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 233 |
234 GrCoordTransform fColorCubeTransform; | 234 GrCoordTransform fColorCubeTransform; |
235 GrTextureAccess fColorCubeAccess; | 235 GrTextureAccess fColorCubeAccess; |
236 | 236 |
237 typedef GrFragmentProcessor INHERITED; | 237 typedef GrFragmentProcessor INHERITED; |
238 }; | 238 }; |
239 | 239 |
240 /////////////////////////////////////////////////////////////////////////////// | 240 /////////////////////////////////////////////////////////////////////////////// |
241 | 241 |
242 GrColorCubeEffect::GrColorCubeEffect(GrTexture* colorCube) | 242 GrColorCubeEffect::GrColorCubeEffect(GrTexture* colorCube) |
243 : fColorCubeTransform(kLocal_GrCoordSet, colorCube) | 243 : fColorCubeTransform(kLocal_GrCoordSet, colorCube, GrTextureParams::kBilerp
_FilterMode) |
244 , fColorCubeAccess(colorCube, "bgra", GrTextureParams::kBilerp_FilterMode) { | 244 , fColorCubeAccess(colorCube, "bgra", GrTextureParams::kBilerp_FilterMode) { |
245 this->initClassID<GrColorCubeEffect>(); | 245 this->initClassID<GrColorCubeEffect>(); |
246 this->addCoordTransform(&fColorCubeTransform); | 246 this->addCoordTransform(&fColorCubeTransform); |
247 this->addTextureAccess(&fColorCubeAccess); | 247 this->addTextureAccess(&fColorCubeAccess); |
248 } | 248 } |
249 | 249 |
250 GrColorCubeEffect::~GrColorCubeEffect() { | 250 GrColorCubeEffect::~GrColorCubeEffect() { |
251 } | 251 } |
252 | 252 |
253 void GrColorCubeEffect::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBu
ilder* b) const { | 253 void GrColorCubeEffect::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBu
ilder* b) const { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 SkAutoTUnref<GrTexture> textureCube; | 360 SkAutoTUnref<GrTexture> textureCube; |
361 if (surface) { | 361 if (surface) { |
362 textureCube.reset(surface->asTexture()); | 362 textureCube.reset(surface->asTexture()); |
363 } else { | 363 } else { |
364 textureCube.reset(context->createTexture(NULL, desc, cacheID, fCubeData-
>data(), 0)); | 364 textureCube.reset(context->createTexture(NULL, desc, cacheID, fCubeData-
>data(), 0)); |
365 } | 365 } |
366 | 366 |
367 return textureCube ? GrColorCubeEffect::Create(textureCube) : NULL; | 367 return textureCube ? GrColorCubeEffect::Create(textureCube) : NULL; |
368 } | 368 } |
369 #endif | 369 #endif |
OLD | NEW |