| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 361 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 362 | 362 |
| 363 GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { | 363 GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { |
| 364 GrContext* ctx = src->getContext(); | 364 GrContext* ctx = src->getContext(); |
| 365 | 365 |
| 366 GrSurfaceDesc desc = src->desc(); | 366 GrSurfaceDesc desc = src->desc(); |
| 367 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp
tr, 0); | 367 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp
tr, 0); |
| 368 if (!dst) { | 368 if (!dst) { |
| 369 return nullptr; | 369 return nullptr; |
| 370 } | 370 } |
| 371 | 371 |
| 372 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); | 372 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); |
| 373 const SkIPoint dstP = SkIPoint::Make(0, 0); | 373 const SkIPoint dstP = SkIPoint::Make(0, 0); |
| 374 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); | 374 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); |
| 375 return dst; | 375 return dst; |
| 376 } | 376 } |
| 377 | 377 |
| OLD | NEW |