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 1684313002: Make copySurface work for texture dsts, return a bool, & add unit test. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: try again Created 4 years, 10 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/batches/GrCopySurfaceBatch.cpp ('k') | tests/CopySurfaceTest.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 "GrCaps.h" 8 #include "GrCaps.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 GrContext* ctx = src->getContext(); 319 GrContext* ctx = src->getContext();
320 320
321 GrSurfaceDesc desc = src->desc(); 321 GrSurfaceDesc desc = src->desc();
322 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp tr, 0); 322 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp tr, 0);
323 if (!dst) { 323 if (!dst) {
324 return nullptr; 324 return nullptr;
325 } 325 }
326 326
327 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); 327 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight);
328 const SkIPoint dstP = SkIPoint::Make(0, 0); 328 const SkIPoint dstP = SkIPoint::Make(0, 0);
329 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); 329 ctx->copySurface(dst, src, srcR, dstP);
330 ctx->flushSurfaceWrites(dst);
330 return dst; 331 return dst;
331 } 332 }
332 333
OLDNEW
« no previous file with comments | « src/gpu/batches/GrCopySurfaceBatch.cpp ('k') | tests/CopySurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698