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

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

Issue 1937553002: Add Gr*Proxy classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix memory bugs 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/gl/GrGLGpu.cpp ('k') | tests/ClearTest.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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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/gl/GrGLGpu.cpp ('k') | tests/ClearTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698