| 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 "SkBitmapCache.h" | 8 #include "SkBitmapCache.h" |
| 9 #include "SkImage_Gpu.h" | 9 #include "SkImage_Gpu.h" |
| 10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 376 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 377 | 377 |
| 378 GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { | 378 GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { |
| 379 GrContext* ctx = src->getContext(); | 379 GrContext* ctx = src->getContext(); |
| 380 | 380 |
| 381 GrSurfaceDesc desc = src->desc(); | 381 GrSurfaceDesc desc = src->desc(); |
| 382 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp
tr, 0); | 382 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp
tr, 0); |
| 383 if (!dst) { | 383 if (!dst) { |
| 384 return nullptr; | 384 return nullptr; |
| 385 } | 385 } |
| 386 | 386 |
| 387 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); | 387 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); |
| 388 const SkIPoint dstP = SkIPoint::Make(0, 0); | 388 const SkIPoint dstP = SkIPoint::Make(0, 0); |
| 389 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); | 389 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); |
| 390 return dst; | 390 return dst; |
| 391 } | 391 } |
| 392 | 392 |
| OLD | NEW |