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 "SkAutoPixmapStorage.h" | 8 #include "SkAutoPixmapStorage.h" |
9 #include "GrCaps.h" | 9 #include "GrCaps.h" |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 SkAutoTUnref<GrTexture> vTex(ctx->textureProvider()->wrapBackendTexture( | 246 SkAutoTUnref<GrTexture> vTex(ctx->textureProvider()->wrapBackendTexture( |
247 vDesc, kBorrow_GrWrapOwnership)); | 247 vDesc, kBorrow_GrWrapOwnership)); |
248 if (!yTex || !uTex || !vTex) { | 248 if (!yTex || !uTex || !vTex) { |
249 return nullptr; | 249 return nullptr; |
250 } | 250 } |
251 | 251 |
252 const int width = yuvSizes[0].fWidth; | 252 const int width = yuvSizes[0].fWidth; |
253 const int height = yuvSizes[0].fHeight; | 253 const int height = yuvSizes[0].fHeight; |
254 | 254 |
255 // Needs to be a render target in order to draw to it for the yuv->rgb conve
rsion. | 255 // Needs to be a render target in order to draw to it for the yuv->rgb conve
rsion. |
256 sk_sp<GrDrawContext> drawContext(ctx->newDrawContext(GrContext::kTight_Backi
ngFit, | 256 sk_sp<GrDrawContext> drawContext(ctx->newDrawContext(SkBackingFit::kExact, |
257 width, height, | 257 width, height, |
258 kRGBA_8888_GrPixelConfi
g, | 258 kRGBA_8888_GrPixelConfi
g, |
259 0, | 259 0, |
260 origin)); | 260 origin)); |
261 if (!drawContext) { | 261 if (!drawContext) { |
262 return nullptr; | 262 return nullptr; |
263 } | 263 } |
264 | 264 |
265 GrPaint paint; | 265 GrPaint paint; |
266 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); | 266 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 return nullptr; | 449 return nullptr; |
450 } | 450 } |
451 | 451 |
452 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); | 452 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); |
453 const SkIPoint dstP = SkIPoint::Make(0, 0); | 453 const SkIPoint dstP = SkIPoint::Make(0, 0); |
454 ctx->copySurface(dst, src, srcR, dstP); | 454 ctx->copySurface(dst, src, srcR, dstP); |
455 ctx->flushSurfaceWrites(dst); | 455 ctx->flushSurfaceWrites(dst); |
456 return dst; | 456 return dst; |
457 } | 457 } |
458 | 458 |
OLD | NEW |