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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
359 } | 359 } |
360 } | 360 } |
361 | 361 |
362 GrSurfaceDesc yuvDesc; | 362 GrSurfaceDesc yuvDesc; |
363 yuvDesc.fConfig = kAlpha_8_GrPixelConfig; | 363 yuvDesc.fConfig = kAlpha_8_GrPixelConfig; |
364 SkAutoTUnref<GrTexture> yuvTextures[3]; | 364 SkAutoTUnref<GrTexture> yuvTextures[3]; |
365 for (int i = 0; i < 3; ++i) { | 365 for (int i = 0; i < 3; ++i) { |
366 yuvDesc.fWidth = yuvInfo.fSize[i].fWidth; | 366 yuvDesc.fWidth = yuvInfo.fSize[i].fWidth; |
367 yuvDesc.fHeight = yuvInfo.fSize[i].fHeight; | 367 yuvDesc.fHeight = yuvInfo.fSize[i].fHeight; |
368 yuvTextures[i].reset( | 368 yuvTextures[i].reset( |
369 ctx->refScratchTexture(yuvDesc, GrContext::kApprox_ScratchTexMatch)) ; | 369 ctx->refScratchTexture(yuvDesc, GrContext::kExact_ScratchTexMatch)); |
bsalomon
2015/03/05 16:13:05
Maybe only do this if we will use bilerp? Otherwis
sugoi1
2015/03/05 16:22:35
Done.
| |
370 if (!yuvTextures[i] || | 370 if (!yuvTextures[i] || |
371 !yuvTextures[i]->writePixels(0, 0, yuvDesc.fWidth, yuvDesc.fHeight, | 371 !yuvTextures[i]->writePixels(0, 0, yuvDesc.fWidth, yuvDesc.fHeight, |
372 yuvDesc.fConfig, planes[i], yuvInfo.fRo wBytes[i])) { | 372 yuvDesc.fConfig, planes[i], yuvInfo.fRo wBytes[i])) { |
373 return NULL; | 373 return NULL; |
374 } | 374 } |
375 } | 375 } |
376 | 376 |
377 GrSurfaceDesc rtDesc = desc; | 377 GrSurfaceDesc rtDesc = desc; |
378 rtDesc.fFlags = rtDesc.fFlags | kRenderTarget_GrSurfaceFlag; | 378 rtDesc.fFlags = rtDesc.fFlags | kRenderTarget_GrSurfaceFlag; |
379 | 379 |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
716 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) { | 716 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) { |
717 grPaint->addColorProcessor(fp)->unref(); | 717 grPaint->addColorProcessor(fp)->unref(); |
718 constantColor = false; | 718 constantColor = false; |
719 } | 719 } |
720 } | 720 } |
721 | 721 |
722 // The grcolor is automatically set when calling asFragmentProcessor. | 722 // The grcolor is automatically set when calling asFragmentProcessor. |
723 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint. | 723 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint. |
724 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP aint); | 724 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP aint); |
725 } | 725 } |
OLD | NEW |