| 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 388 |
| 389 GrSurfaceDesc desc; | 389 GrSurfaceDesc desc; |
| 390 generate_bitmap_texture_desc(bitmap, &desc); | 390 generate_bitmap_texture_desc(bitmap, &desc); |
| 391 | 391 |
| 392 result = ctx->findAndRefTexture(desc, cacheID, params); | 392 result = ctx->findAndRefTexture(desc, cacheID, params); |
| 393 } | 393 } |
| 394 if (NULL == result) { | 394 if (NULL == result) { |
| 395 result = sk_gr_create_bitmap_texture(ctx, cache, params, bitmap); | 395 result = sk_gr_create_bitmap_texture(ctx, cache, params, bitmap); |
| 396 } | 396 } |
| 397 if (NULL == result) { | 397 if (NULL == result) { |
| 398 GrPrintf("---- failed to create texture for cache [%d %d]\n", | 398 SkDebugf("---- failed to create texture for cache [%d %d]\n", |
| 399 bitmap.width(), bitmap.height()); | 399 bitmap.width(), bitmap.height()); |
| 400 } | 400 } |
| 401 return result; | 401 return result; |
| 402 } | 402 } |
| 403 | 403 |
| 404 /////////////////////////////////////////////////////////////////////////////// | 404 /////////////////////////////////////////////////////////////////////////////// |
| 405 | 405 |
| 406 // alphatype is ignore for now, but if GrPixelConfig is expanded to encompass | 406 // alphatype is ignore for now, but if GrPixelConfig is expanded to encompass |
| 407 // alpha info, that will be considered. | 407 // alpha info, that will be considered. |
| 408 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType) { | 408 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType) { |
| 409 switch (ct) { | 409 switch (ct) { |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 if (shader->asFragmentProcessor(context, skPaint, NULL, &paintColor, &fp
) && fp) { | 574 if (shader->asFragmentProcessor(context, skPaint, NULL, &paintColor, &fp
) && fp) { |
| 575 grPaint->addColorProcessor(fp)->unref(); | 575 grPaint->addColorProcessor(fp)->unref(); |
| 576 constantColor = false; | 576 constantColor = false; |
| 577 } | 577 } |
| 578 } | 578 } |
| 579 | 579 |
| 580 // The grcolor is automatically set when calling asFragmentProcessor. | 580 // The grcolor is automatically set when calling asFragmentProcessor. |
| 581 // If the shader can be seen as an effect it returns true and adds its effec
t to the grpaint. | 581 // If the shader can be seen as an effect it returns true and adds its effec
t to the grpaint. |
| 582 SkPaint2GrPaintNoShader(context, skPaint, paintColor, constantColor, grPaint
); | 582 SkPaint2GrPaintNoShader(context, skPaint, paintColor, constantColor, grPaint
); |
| 583 } | 583 } |
| OLD | NEW |