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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 398 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
399 | 399 |
400 GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { | 400 GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { |
401 GrContext* ctx = src->getContext(); | 401 GrContext* ctx = src->getContext(); |
402 | 402 |
403 GrSurfaceDesc desc = src->desc(); | 403 GrSurfaceDesc desc = src->desc(); |
404 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp
tr, 0); | 404 GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullp
tr, 0); |
405 if (!dst) { | 405 if (!dst) { |
406 return nullptr; | 406 return nullptr; |
407 } | 407 } |
408 | 408 |
409 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); | 409 const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); |
410 const SkIPoint dstP = SkIPoint::Make(0, 0); | 410 const SkIPoint dstP = SkIPoint::Make(0, 0); |
411 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); | 411 ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); |
412 return dst; | 412 return dst; |
413 } | 413 } |
414 | 414 |
OLD | NEW |