| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkImage_Gpu.h" | 8 #include "SkImage_Gpu.h" |
| 9 #include "GrContext.h" | 9 #include "GrContext.h" |
| 10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 return NULL; | 221 return NULL; |
| 222 } | 222 } |
| 223 | 223 |
| 224 GrPaint paint; | 224 GrPaint paint; |
| 225 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); | 225 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); |
| 226 paint.addColorProcessor(GrYUVtoRGBEffect::Create(yTex, uTex, vTex, yuvSizes, | 226 paint.addColorProcessor(GrYUVtoRGBEffect::Create(yTex, uTex, vTex, yuvSizes, |
| 227 colorSpace))->unref(); | 227 colorSpace))->unref(); |
| 228 | 228 |
| 229 const SkRect rect = SkRect::MakeWH(SkIntToScalar(dstDesc.fWidth), | 229 const SkRect rect = SkRect::MakeWH(SkIntToScalar(dstDesc.fWidth), |
| 230 SkIntToScalar(dstDesc.fHeight)); | 230 SkIntToScalar(dstDesc.fHeight)); |
| 231 GrDrawContext* drawContext = ctx->drawContext(); | 231 ctx->drawContext()->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), pain
t, SkMatrix::I(), |
| 232 drawContext->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, SkMa
trix::I(), rect); | 232 rect); |
| 233 ctx->flushSurfaceWrites(dst); | 233 ctx->flushSurfaceWrites(dst); |
| 234 return SkNEW_ARGS(SkImage_Gpu, (dstDesc.fWidth, dstDesc.fHeight, kOpaque_SkA
lphaType, dst, 0, | 234 return SkNEW_ARGS(SkImage_Gpu, (dstDesc.fWidth, dstDesc.fHeight, kOpaque_SkA
lphaType, dst, 0, |
| 235 budgeted)); | 235 budgeted)); |
| 236 } | 236 } |
| OLD | NEW |