OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 #include "SkGr.h" | 8 #include "SkGr.h" |
9 #include "SkColorFilter.h" | 9 #include "SkColorFilter.h" |
10 #include "SkConfig8888.h" | 10 #include "SkConfig8888.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 } else { | 237 } else { |
238 origBitmap.copyTo(&tmpBitmap, kN32_SkColorType); | 238 origBitmap.copyTo(&tmpBitmap, kN32_SkColorType); |
239 // now bitmap points to our temp, which has been promoted to 32bits | 239 // now bitmap points to our temp, which has been promoted to 32bits |
240 bitmap = &tmpBitmap; | 240 bitmap = &tmpBitmap; |
241 desc.fConfig = SkImageInfo2GrPixelConfig(bitmap->info()); | 241 desc.fConfig = SkImageInfo2GrPixelConfig(bitmap->info()); |
242 } | 242 } |
243 } | 243 } |
244 | 244 |
245 // Is this an ETC1 encoded texture? | 245 // Is this an ETC1 encoded texture? |
246 #ifndef SK_IGNORE_ETC1_SUPPORT | 246 #ifndef SK_IGNORE_ETC1_SUPPORT |
247 else if (cache && ctx->getGpu()->caps()->isConfigTexturable(kETC1_GrPixelCon fig)) { | 247 else if (cache |
248 && ctx->getGpu()->caps()->isConfigTexturable(kETC1_GrPixelConfig) | |
robertphillips
2014/06/04 18:53:36
What is this fixing?
krajcevski
2014/06/04 19:26:53
If the bitmap had compressed data and was then unc
robertphillips
2014/06/04 19:46:37
That needs a comment!
krajcevski
2014/06/04 19:57:16
Done.
| |
249 && !(bitmap->readyToDraw())) { | |
248 GrTexture *texture = load_etc1_texture(ctx, params, *bitmap, desc); | 250 GrTexture *texture = load_etc1_texture(ctx, params, *bitmap, desc); |
249 if (NULL != texture) { | 251 if (NULL != texture) { |
250 return texture; | 252 return texture; |
251 } | 253 } |
252 } | 254 } |
253 #endif // SK_IGNORE_ETC1_SUPPORT | 255 #endif // SK_IGNORE_ETC1_SUPPORT |
254 | 256 |
255 SkAutoLockPixels alp(*bitmap); | 257 SkAutoLockPixels alp(*bitmap); |
256 if (!bitmap->readyToDraw()) { | 258 if (!bitmap->readyToDraw()) { |
257 return NULL; | 259 return NULL; |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
510 copy.setShader(NULL); | 512 copy.setShader(NULL); |
511 // modulate the paint alpha by the shader's solid color alpha | 513 // modulate the paint alpha by the shader's solid color alpha |
512 U8CPU newA = SkMulDiv255Round(SkColorGetA(color), copy.getAlpha()); | 514 U8CPU newA = SkMulDiv255Round(SkColorGetA(color), copy.getAlpha()); |
513 copy.setColor(SkColorSetA(color, newA)); | 515 copy.setColor(SkColorSetA(color, newA)); |
514 SkPaint2GrPaintNoShader(context, copy, false, constantColor, grPaint ); | 516 SkPaint2GrPaintNoShader(context, copy, false, constantColor, grPaint ); |
515 } else { | 517 } else { |
516 SkPaint2GrPaintNoShader(context, skPaint, false, constantColor, grPa int); | 518 SkPaint2GrPaintNoShader(context, skPaint, false, constantColor, grPa int); |
517 } | 519 } |
518 } | 520 } |
519 } | 521 } |
OLD | NEW |