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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); |
267 paint.addColorFragmentProcessor(GrYUVEffect::CreateYUVToRGB(yTex, uTex, vTex
, yuvSizes, | 267 paint.addColorFragmentProcessor(GrYUVEffect::CreateYUVToRGB(yTex, uTex, vTex
, yuvSizes, |
268 colorSpace))->un
ref(); | 268 colorSpace))->un
ref(); |
269 | 269 |
270 const SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(heigh
t)); | 270 const SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(heigh
t)); |
271 | 271 |
272 drawContext->drawRect(GrClip::WideOpen(), paint, SkMatrix::I(), rect); | 272 drawContext->drawRect(GrNoClip(), paint, SkMatrix::I(), rect); |
273 ctx->flushSurfaceWrites(drawContext->accessRenderTarget()); | 273 ctx->flushSurfaceWrites(drawContext->accessRenderTarget()); |
274 return sk_make_sp<SkImage_Gpu>(width, height, kNeedNewImageUniqueID, | 274 return sk_make_sp<SkImage_Gpu>(width, height, kNeedNewImageUniqueID, |
275 kOpaque_SkAlphaType, | 275 kOpaque_SkAlphaType, |
276 drawContext->asTexture().get(), budgeted); | 276 drawContext->asTexture().get(), budgeted); |
277 } | 277 } |
278 | 278 |
279 static sk_sp<SkImage> create_image_from_maker(GrTextureMaker* maker, SkAlphaType
at, uint32_t id) { | 279 static sk_sp<SkImage> create_image_from_maker(GrTextureMaker* maker, SkAlphaType
at, uint32_t id) { |
280 SkAutoTUnref<GrTexture> texture(maker->refTextureForParams(GrTextureParams::
ClampNoFilter())); | 280 SkAutoTUnref<GrTexture> texture(maker->refTextureForParams(GrTextureParams::
ClampNoFilter())); |
281 if (!texture) { | 281 if (!texture) { |
282 return nullptr; | 282 return nullptr; |
(...skipping 166 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 |