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 | 9 |
10 #include "GrXferProcessor.h" | 10 #include "GrXferProcessor.h" |
11 #include "SkColorFilter.h" | 11 #include "SkColorFilter.h" |
12 #include "SkConfig8888.h" | 12 #include "SkConfig8888.h" |
13 #include "SkData.h" | 13 #include "SkData.h" |
| 14 #include "SkErrorInternals.h" |
14 #include "SkMessageBus.h" | 15 #include "SkMessageBus.h" |
15 #include "SkPixelRef.h" | 16 #include "SkPixelRef.h" |
16 #include "SkResourceCache.h" | 17 #include "SkResourceCache.h" |
17 #include "SkTextureCompressor.h" | 18 #include "SkTextureCompressor.h" |
18 #include "SkYUVPlanesCache.h" | 19 #include "SkYUVPlanesCache.h" |
19 #include "effects/GrDitherEffect.h" | 20 #include "effects/GrDitherEffect.h" |
20 #include "effects/GrPorterDuffXferProcessor.h" | 21 #include "effects/GrPorterDuffXferProcessor.h" |
21 #include "effects/GrYUVtoRGBEffect.h" | 22 #include "effects/GrYUVtoRGBEffect.h" |
22 | 23 |
23 #ifndef SK_IGNORE_ETC1_SUPPORT | 24 #ifndef SK_IGNORE_ETC1_SUPPORT |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 if (result) { | 554 if (result) { |
554 return result; | 555 return result; |
555 } | 556 } |
556 } | 557 } |
557 | 558 |
558 result = create_bitmap_texture(ctx, bitmap, stretch, key, resizedKey); | 559 result = create_bitmap_texture(ctx, bitmap, stretch, key, resizedKey); |
559 if (result) { | 560 if (result) { |
560 return result; | 561 return result; |
561 } | 562 } |
562 | 563 |
563 SkDebugf("---- failed to create texture for cache [%d %d]\n", | 564 SkErrorInternals::SetError( kInternalError_SkError, |
564 bitmap.width(), bitmap.height()); | 565 "---- failed to create texture for cache [%d %d]
\n", |
| 566 bitmap.width(), bitmap.height()); |
565 | 567 |
566 return NULL; | 568 return NULL; |
567 } | 569 } |
568 /////////////////////////////////////////////////////////////////////////////// | 570 /////////////////////////////////////////////////////////////////////////////// |
569 | 571 |
570 // alphatype is ignore for now, but if GrPixelConfig is expanded to encompass | 572 // alphatype is ignore for now, but if GrPixelConfig is expanded to encompass |
571 // alpha info, that will be considered. | 573 // alpha info, that will be considered. |
572 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType, SkColorProf
ileType pt) { | 574 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType, SkColorProf
ileType pt) { |
573 switch (ct) { | 575 switch (ct) { |
574 case kUnknown_SkColorType: | 576 case kUnknown_SkColorType: |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol
or, &fp) && fp) { | 713 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol
or, &fp) && fp) { |
712 grPaint->addColorProcessor(fp)->unref(); | 714 grPaint->addColorProcessor(fp)->unref(); |
713 constantColor = false; | 715 constantColor = false; |
714 } | 716 } |
715 } | 717 } |
716 | 718 |
717 // The grcolor is automatically set when calling asFragmentProcessor. | 719 // The grcolor is automatically set when calling asFragmentProcessor. |
718 // If the shader can be seen as an effect it returns true and adds its effec
t to the grpaint. | 720 // If the shader can be seen as an effect it returns true and adds its effec
t to the grpaint. |
719 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP
aint); | 721 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP
aint); |
720 } | 722 } |
OLD | NEW |