| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkAtomics.h" | 8 #include "SkAtomics.h" |
| 9 #include "SkBitmapProcShader.h" | 9 #include "SkBitmapProcShader.h" |
| 10 #include "SkColorShader.h" | 10 #include "SkColorShader.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 208 |
| 209 SkShader::BitmapType SkShader::asABitmap(SkBitmap*, SkMatrix*, TileMode*) const
{ | 209 SkShader::BitmapType SkShader::asABitmap(SkBitmap*, SkMatrix*, TileMode*) const
{ |
| 210 return kNone_BitmapType; | 210 return kNone_BitmapType; |
| 211 } | 211 } |
| 212 | 212 |
| 213 SkShader::GradientType SkShader::asAGradient(GradientInfo* info) const { | 213 SkShader::GradientType SkShader::asAGradient(GradientInfo* info) const { |
| 214 return kNone_GradientType; | 214 return kNone_GradientType; |
| 215 } | 215 } |
| 216 | 216 |
| 217 bool SkShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix&,
const SkMatrix*, | 217 bool SkShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix&,
const SkMatrix*, |
| 218 GrColor*, GrShaderDataManager*, GrFragmentPro
cessor**) const { | 218 GrColor*, GrProcessorDataManager*, |
| 219 GrFragmentProcessor**) const { |
| 219 return false; | 220 return false; |
| 220 } | 221 } |
| 221 | 222 |
| 222 SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const { | 223 SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const { |
| 223 return NULL; | 224 return NULL; |
| 224 } | 225 } |
| 225 | 226 |
| 226 SkShader* SkShader::CreateEmptyShader() { | 227 SkShader* SkShader::CreateEmptyShader() { |
| 227 return SkNEW(SkEmptyShader); | 228 return SkNEW(SkEmptyShader); |
| 228 } | 229 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 info->fTileMode = SkShader::kRepeat_TileMode; | 340 info->fTileMode = SkShader::kRepeat_TileMode; |
| 340 } | 341 } |
| 341 return kColor_GradientType; | 342 return kColor_GradientType; |
| 342 } | 343 } |
| 343 | 344 |
| 344 #if SK_SUPPORT_GPU | 345 #if SK_SUPPORT_GPU |
| 345 | 346 |
| 346 #include "SkGr.h" | 347 #include "SkGr.h" |
| 347 | 348 |
| 348 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint& paint, const
SkMatrix&, | 349 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint& paint, const
SkMatrix&, |
| 349 const SkMatrix*, GrColor* paintColor, Gr
ShaderDataManager*, | 350 const SkMatrix*, GrColor* paintColor, |
| 350 GrFragmentProcessor** fp) const { | 351 GrProcessorDataManager*, GrFragmentProce
ssor** fp) const { |
| 351 *fp = NULL; | 352 *fp = NULL; |
| 352 SkColor skColor = fColor; | 353 SkColor skColor = fColor; |
| 353 U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha()); | 354 U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha()); |
| 354 *paintColor = SkColor2GrColor(SkColorSetA(skColor, newA)); | 355 *paintColor = SkColor2GrColor(SkColorSetA(skColor, newA)); |
| 355 return true; | 356 return true; |
| 356 } | 357 } |
| 357 | 358 |
| 358 #else | 359 #else |
| 359 | 360 |
| 360 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatr
ix&, | 361 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatr
ix&, |
| 361 const SkMatrix*, GrColor*, GrShaderDataM
anager*, | 362 const SkMatrix*, GrColor*, GrProcessorDa
taManager*, |
| 362 GrFragmentProcessor**) const { | 363 GrFragmentProcessor**) const { |
| 363 SkDEBUGFAIL("Should not call in GPU-less build"); | 364 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 364 return false; | 365 return false; |
| 365 } | 366 } |
| 366 | 367 |
| 367 #endif | 368 #endif |
| 368 | 369 |
| 369 #ifndef SK_IGNORE_TO_STRING | 370 #ifndef SK_IGNORE_TO_STRING |
| 370 void SkColorShader::toString(SkString* str) const { | 371 void SkColorShader::toString(SkString* str) const { |
| 371 str->append("SkColorShader: ("); | 372 str->append("SkColorShader: ("); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 389 #include "SkEmptyShader.h" | 390 #include "SkEmptyShader.h" |
| 390 | 391 |
| 391 void SkEmptyShader::toString(SkString* str) const { | 392 void SkEmptyShader::toString(SkString* str) const { |
| 392 str->append("SkEmptyShader: ("); | 393 str->append("SkEmptyShader: ("); |
| 393 | 394 |
| 394 this->INHERITED::toString(str); | 395 this->INHERITED::toString(str); |
| 395 | 396 |
| 396 str->append(")"); | 397 str->append(")"); |
| 397 } | 398 } |
| 398 #endif | 399 #endif |
| OLD | NEW |