| 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*, GrFragmentProcessor**) const { | 218 GrColor*, GrShaderDataManager*, GrFragmentPro
cessor**) const { |
| 219 return false; | 219 return false; |
| 220 } | 220 } |
| 221 | 221 |
| 222 SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const { | 222 SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const { |
| 223 return NULL; | 223 return NULL; |
| 224 } | 224 } |
| 225 | 225 |
| 226 SkShader* SkShader::CreateEmptyShader() { | 226 SkShader* SkShader::CreateEmptyShader() { |
| 227 return SkNEW(SkEmptyShader); | 227 return SkNEW(SkEmptyShader); |
| 228 } | 228 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 info->fTileMode = SkShader::kRepeat_TileMode; | 339 info->fTileMode = SkShader::kRepeat_TileMode; |
| 340 } | 340 } |
| 341 return kColor_GradientType; | 341 return kColor_GradientType; |
| 342 } | 342 } |
| 343 | 343 |
| 344 #if SK_SUPPORT_GPU | 344 #if SK_SUPPORT_GPU |
| 345 | 345 |
| 346 #include "SkGr.h" | 346 #include "SkGr.h" |
| 347 | 347 |
| 348 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint& paint, const
SkMatrix&, | 348 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint& paint, const
SkMatrix&, |
| 349 const SkMatrix*, GrColor* paintColor, | 349 const SkMatrix*, GrColor* paintColor, Gr
ShaderDataManager*, |
| 350 GrFragmentProcessor** fp) const { | 350 GrFragmentProcessor** fp) const { |
| 351 *fp = NULL; | 351 *fp = NULL; |
| 352 SkColor skColor = fColor; | 352 SkColor skColor = fColor; |
| 353 U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha()); | 353 U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha()); |
| 354 *paintColor = SkColor2GrColor(SkColorSetA(skColor, newA)); | 354 *paintColor = SkColor2GrColor(SkColorSetA(skColor, newA)); |
| 355 return true; | 355 return true; |
| 356 } | 356 } |
| 357 | 357 |
| 358 #else | 358 #else |
| 359 | 359 |
| 360 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatr
ix&, | 360 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatr
ix&, |
| 361 const SkMatrix*, GrColor*, | 361 const SkMatrix*, GrColor*, GrShaderDataM
anager*, |
| 362 GrFragmentProcessor**) const { | 362 GrFragmentProcessor**) const { |
| 363 SkDEBUGFAIL("Should not call in GPU-less build"); | 363 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 364 return false; | 364 return false; |
| 365 } | 365 } |
| 366 | 366 |
| 367 #endif | 367 #endif |
| 368 | 368 |
| 369 #ifndef SK_IGNORE_TO_STRING | 369 #ifndef SK_IGNORE_TO_STRING |
| 370 void SkColorShader::toString(SkString* str) const { | 370 void SkColorShader::toString(SkString* str) const { |
| 371 str->append("SkColorShader: ("); | 371 str->append("SkColorShader: ("); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 389 #include "SkEmptyShader.h" | 389 #include "SkEmptyShader.h" |
| 390 | 390 |
| 391 void SkEmptyShader::toString(SkString* str) const { | 391 void SkEmptyShader::toString(SkString* str) const { |
| 392 str->append("SkEmptyShader: ("); | 392 str->append("SkEmptyShader: ("); |
| 393 | 393 |
| 394 this->INHERITED::toString(str); | 394 this->INHERITED::toString(str); |
| 395 | 395 |
| 396 str->append(")"); | 396 str->append(")"); |
| 397 } | 397 } |
| 398 #endif | 398 #endif |
| OLD | NEW |