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 "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 Loading... |
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); | 329 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); |
330 ctx->flushSurfaceWrites(dst); | |
331 return dst; | 330 return dst; |
332 } | 331 } |
333 | 332 |
OLD | NEW |