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 "SkBitmapProcShader.h" | 8 #include "SkBitmapProcShader.h" |
9 #include "SkColorShader.h" | 9 #include "SkColorShader.h" |
10 #include "SkEmptyShader.h" | 10 #include "SkEmptyShader.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 ////////////////////////////////////////////////////////////////////////////// | 207 ////////////////////////////////////////////////////////////////////////////// |
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*,
GrColor*, | 217 bool SkShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix&,
const SkMatrix*, |
218 GrFragmentProcessor**) const { | 218 GrColor*, GrFragmentProcessor**) 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 info->fColorCount = 1; | 338 info->fColorCount = 1; |
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 GrColor* paintColor, GrFragmentProcessor
** fp) const { | 349 const SkMatrix*, GrColor* paintColor, |
| 350 GrFragmentProcessor** fp) const { |
350 *fp = NULL; | 351 *fp = NULL; |
351 SkColor skColor = fColor; | 352 SkColor skColor = fColor; |
352 U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha()); | 353 U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha()); |
353 *paintColor = SkColor2GrColor(SkColorSetA(skColor, newA)); | 354 *paintColor = SkColor2GrColor(SkColorSetA(skColor, newA)); |
354 return true; | 355 return true; |
355 } | 356 } |
356 | 357 |
357 #else | 358 #else |
358 | 359 |
359 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatr
ix*, GrColor*, | 360 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatr
ix&, |
| 361 const SkMatrix*, GrColor*, |
360 GrFragmentProcessor**) const { | 362 GrFragmentProcessor**) const { |
361 SkDEBUGFAIL("Should not call in GPU-less build"); | 363 SkDEBUGFAIL("Should not call in GPU-less build"); |
362 return false; | 364 return false; |
363 } | 365 } |
364 | 366 |
365 #endif | 367 #endif |
366 | 368 |
367 #ifndef SK_IGNORE_TO_STRING | 369 #ifndef SK_IGNORE_TO_STRING |
368 void SkColorShader::toString(SkString* str) const { | 370 void SkColorShader::toString(SkString* str) const { |
369 str->append("SkColorShader: ("); | 371 str->append("SkColorShader: ("); |
(...skipping 17 matching lines...) Expand all Loading... |
387 #include "SkEmptyShader.h" | 389 #include "SkEmptyShader.h" |
388 | 390 |
389 void SkEmptyShader::toString(SkString* str) const { | 391 void SkEmptyShader::toString(SkString* str) const { |
390 str->append("SkEmptyShader: ("); | 392 str->append("SkEmptyShader: ("); |
391 | 393 |
392 this->INHERITED::toString(str); | 394 this->INHERITED::toString(str); |
393 | 395 |
394 str->append(")"); | 396 str->append(")"); |
395 } | 397 } |
396 #endif | 398 #endif |
OLD | NEW |