Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/image/SkImage_Gpu.cpp

Issue 1971343002: Convert GrClip to an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_clipout
Patch Set: fix crash Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.cpp ('k') | tests/ClipBoundsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.cpp ('k') | tests/ClipBoundsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698