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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 281 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
282 | 282 |
283 GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { | 283 GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { |
284 GrContext* ctx = src->getContext(); | 284 GrContext* ctx = src->getContext(); |
285 | 285 |
286 GrSurfaceDesc desc = src->desc(); | 286 GrSurfaceDesc desc = src->desc(); |
287 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp
tr, 0); | 287 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp
tr, 0); |
288 if (!dst) { | 288 if (!dst) { |
289 return nullptr; | 289 return nullptr; |
290 } | 290 } |
291 | 291 |
292 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); | 292 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); |
293 const SkIPoint dstP = SkIPoint::Make(0, 0); | 293 const SkIPoint dstP = SkIPoint::Make(0, 0); |
294 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); | 294 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); |
295 return dst; | 295 return dst; |
296 } | 296 } |
297 | 297 |
OLD | NEW |