| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "SkColorPriv.h" | 8 #include "SkColorPriv.h" |
| 9 #include "SkReadBuffer.h" | 9 #include "SkReadBuffer.h" |
| 10 #include "SkWriteBuffer.h" | 10 #include "SkWriteBuffer.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 /////////////////////////////////////////////////////////////////////////////// | 262 /////////////////////////////////////////////////////////////////////////////// |
| 263 | 263 |
| 264 #include "SkUnPreMultiply.h" | 264 #include "SkUnPreMultiply.h" |
| 265 #include "SkColorShader.h" | 265 #include "SkColorShader.h" |
| 266 #include "SkEmptyShader.h" | 266 #include "SkEmptyShader.h" |
| 267 | 267 |
| 268 // returns true and set color if the bitmap can be drawn as a single color | 268 // returns true and set color if the bitmap can be drawn as a single color |
| 269 // (for efficiency) | 269 // (for efficiency) |
| 270 static bool canUseColorShader(const SkBitmap& bm, SkColor* color) { | 270 static bool canUseColorShader(const SkBitmap& bm, SkColor* color) { |
| 271 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK |
| 272 // HWUI does not support color shaders (see b/22390304) |
| 273 return false; |
| 274 #endif |
| 275 |
| 271 if (1 != bm.width() || 1 != bm.height()) { | 276 if (1 != bm.width() || 1 != bm.height()) { |
| 272 return false; | 277 return false; |
| 273 } | 278 } |
| 274 | 279 |
| 275 SkAutoLockPixels alp(bm); | 280 SkAutoLockPixels alp(bm); |
| 276 if (!bm.readyToDraw()) { | 281 if (!bm.readyToDraw()) { |
| 277 return false; | 282 return false; |
| 278 } | 283 } |
| 279 | 284 |
| 280 switch (bm.colorType()) { | 285 switch (bm.colorType()) { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 #else | 457 #else |
| 453 | 458 |
| 454 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix&, | 459 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix&, |
| 455 const SkMatrix*, GrColor*, GrProces
sorDataManager*, | 460 const SkMatrix*, GrColor*, GrProces
sorDataManager*, |
| 456 GrFragmentProcessor**) const { | 461 GrFragmentProcessor**) const { |
| 457 SkDEBUGFAIL("Should not call in GPU-less build"); | 462 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 458 return false; | 463 return false; |
| 459 } | 464 } |
| 460 | 465 |
| 461 #endif | 466 #endif |
| OLD | NEW |