OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #ifndef SkGradientShaderPriv_DEFINED | 8 #ifndef SkGradientShaderPriv_DEFINED |
9 #define SkGradientShaderPriv_DEFINED | 9 #define SkGradientShaderPriv_DEFINED |
10 | 10 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 GrGradientEffect(GrContext* ctx, | 335 GrGradientEffect(GrContext* ctx, |
336 const SkGradientShaderBase& shader, | 336 const SkGradientShaderBase& shader, |
337 const SkMatrix& matrix, | 337 const SkMatrix& matrix, |
338 SkShader::TileMode tileMode); | 338 SkShader::TileMode tileMode); |
339 | 339 |
340 virtual ~GrGradientEffect(); | 340 virtual ~GrGradientEffect(); |
341 | 341 |
342 bool useAtlas() const { return SkToBool(-1 != fRow); } | 342 bool useAtlas() const { return SkToBool(-1 != fRow); } |
343 SkScalar getYCoord() const { return fYCoord; }; | 343 SkScalar getYCoord() const { return fYCoord; }; |
344 | 344 |
| 345 virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags
) const SK_OVERRIDE; |
| 346 |
345 SkGradientShaderBase::GpuColorType getColorType() const { return fColorType;
} | 347 SkGradientShaderBase::GpuColorType getColorType() const { return fColorType;
} |
346 | 348 |
347 enum PremulType { | 349 enum PremulType { |
348 kBeforeInterp_PremulType, | 350 kBeforeInterp_PremulType, |
349 kAfterInterp_PremulType, | 351 kAfterInterp_PremulType, |
350 }; | 352 }; |
351 | 353 |
352 PremulType getPremulType() const { return fPremulType; } | 354 PremulType getPremulType() const { return fPremulType; } |
353 | 355 |
354 const SkColor* getColors(int pos) const { | 356 const SkColor* getColors(int pos) const { |
(...skipping 12 matching lines...) Expand all Loading... |
367 passed to the gradient factory rather than the array. | 369 passed to the gradient factory rather than the array. |
368 */ | 370 */ |
369 static const int kMaxRandomGradientColors = 4; | 371 static const int kMaxRandomGradientColors = 4; |
370 static int RandomGradientParams(SkRandom* r, | 372 static int RandomGradientParams(SkRandom* r, |
371 SkColor colors[kMaxRandomGradientColors], | 373 SkColor colors[kMaxRandomGradientColors], |
372 SkScalar** stops, | 374 SkScalar** stops, |
373 SkShader::TileMode* tm); | 375 SkShader::TileMode* tm); |
374 | 376 |
375 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE; | 377 virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE; |
376 | 378 |
377 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE; | |
378 | |
379 const GrCoordTransform& getCoordTransform() const { return fCoordTransform;
} | 379 const GrCoordTransform& getCoordTransform() const { return fCoordTransform;
} |
380 | 380 |
381 private: | 381 private: |
382 static const GrCoordSet kCoordSet = kLocal_GrCoordSet; | 382 static const GrCoordSet kCoordSet = kLocal_GrCoordSet; |
383 | 383 |
384 GrCoordTransform fCoordTransform; | 384 GrCoordTransform fCoordTransform; |
385 GrTextureAccess fTextureAccess; | 385 GrTextureAccess fTextureAccess; |
386 SkScalar fYCoord; | 386 SkScalar fYCoord; |
387 GrTextureStripAtlas* fAtlas; | 387 GrTextureStripAtlas* fAtlas; |
388 int fRow; | 388 int fRow; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 GrGLProgramDataManager::UniformHandle fColorStartUni; | 466 GrGLProgramDataManager::UniformHandle fColorStartUni; |
467 GrGLProgramDataManager::UniformHandle fColorMidUni; | 467 GrGLProgramDataManager::UniformHandle fColorMidUni; |
468 GrGLProgramDataManager::UniformHandle fColorEndUni; | 468 GrGLProgramDataManager::UniformHandle fColorEndUni; |
469 | 469 |
470 typedef GrGLFragmentProcessor INHERITED; | 470 typedef GrGLFragmentProcessor INHERITED; |
471 }; | 471 }; |
472 | 472 |
473 #endif | 473 #endif |
474 | 474 |
475 #endif | 475 #endif |
OLD | NEW |