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 "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 273 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
274 | 274 |
275 GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { | 275 GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { |
276 GrContext* ctx = src->getContext(); | 276 GrContext* ctx = src->getContext(); |
277 | 277 |
278 GrSurfaceDesc desc = src->desc(); | 278 GrSurfaceDesc desc = src->desc(); |
279 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp
tr, 0); | 279 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp
tr, 0); |
280 if (!dst) { | 280 if (!dst) { |
281 return nullptr; | 281 return nullptr; |
282 } | 282 } |
283 | 283 |
284 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); | 284 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); |
285 const SkIPoint dstP = SkIPoint::Make(0, 0); | 285 const SkIPoint dstP = SkIPoint::Make(0, 0); |
286 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); | 286 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); |
287 return dst; | 287 return dst; |
288 } | 288 } |
289 | 289 |
OLD | NEW |