| 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" |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 GrTexture* result = create_texture_for_bmp(ctx, optionalKey, rtDesc, pixelRe
f, NULL, 0); | 384 GrTexture* result = create_texture_for_bmp(ctx, optionalKey, rtDesc, pixelRe
f, NULL, 0); |
| 385 if (!result) { | 385 if (!result) { |
| 386 return NULL; | 386 return NULL; |
| 387 } | 387 } |
| 388 | 388 |
| 389 GrRenderTarget* renderTarget = result->asRenderTarget(); | 389 GrRenderTarget* renderTarget = result->asRenderTarget(); |
| 390 SkASSERT(renderTarget); | 390 SkASSERT(renderTarget); |
| 391 | 391 |
| 392 SkAutoTUnref<GrFragmentProcessor> | 392 SkAutoTUnref<GrFragmentProcessor> |
| 393 yuvToRgbProcessor(GrYUVtoRGBEffect::Create(yuvTextures[0], yuvTextures[1
], yuvTextures[2], | 393 yuvToRgbProcessor(GrYUVtoRGBEffect::Create(yuvTextures[0], yuvTextures[1
], yuvTextures[2], |
| 394 yuvInfo.fColorSpace)); | 394 yuvInfo.fSize, yuvInfo.fColor
Space)); |
| 395 GrPaint paint; | 395 GrPaint paint; |
| 396 paint.addColorProcessor(yuvToRgbProcessor); | 396 paint.addColorProcessor(yuvToRgbProcessor); |
| 397 SkRect r = SkRect::MakeWH(SkIntToScalar(yuvInfo.fSize[0].fWidth), | 397 SkRect r = SkRect::MakeWH(SkIntToScalar(yuvInfo.fSize[0].fWidth), |
| 398 SkIntToScalar(yuvInfo.fSize[0].fHeight)); | 398 SkIntToScalar(yuvInfo.fSize[0].fHeight)); |
| 399 GrContext::AutoRenderTarget autoRT(ctx, renderTarget); | 399 GrContext::AutoRenderTarget autoRT(ctx, renderTarget); |
| 400 GrContext::AutoClip ac(ctx, GrContext::AutoClip::kWideOpen_InitialClip); | 400 GrContext::AutoClip ac(ctx, GrContext::AutoClip::kWideOpen_InitialClip); |
| 401 ctx->drawRect(paint, SkMatrix::I(), r); | 401 ctx->drawRect(paint, SkMatrix::I(), r); |
| 402 | 402 |
| 403 return result; | 403 return result; |
| 404 } | 404 } |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol
or, &fp) && fp) { | 723 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol
or, &fp) && fp) { |
| 724 grPaint->addColorProcessor(fp)->unref(); | 724 grPaint->addColorProcessor(fp)->unref(); |
| 725 constantColor = false; | 725 constantColor = false; |
| 726 } | 726 } |
| 727 } | 727 } |
| 728 | 728 |
| 729 // The grcolor is automatically set when calling asFragmentProcessor. | 729 // The grcolor is automatically set when calling asFragmentProcessor. |
| 730 // If the shader can be seen as an effect it returns true and adds its effec
t to the grpaint. | 730 // If the shader can be seen as an effect it returns true and adds its effec
t to the grpaint. |
| 731 SkPaint2GrPaintNoShader(context, skPaint, paintColor, constantColor, grPaint
); | 731 SkPaint2GrPaintNoShader(context, skPaint, paintColor, constantColor, grPaint
); |
| 732 } | 732 } |
| OLD | NEW |