diff options
Diffstat (limited to 'include/gpu/GrContext.h')
-rw-r--r-- | include/gpu/GrContext.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index 4245b7fa94..00a92836c5 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -278,17 +278,24 @@ public: * @param src the surface to copy from. * @param srcRect the rectangle of the src that should be copied. * @param dstPoint the translation applied when writing the srcRect's pixels to the dst. + * @param pixelOpsFlags see PixelOpsFlags enum above. (kUnpremul_PixelOpsFlag is not allowed). */ - bool copySurface(GrSurface* dst, + void copySurface(GrSurface* dst, GrSurface* src, const SkIRect& srcRect, - const SkIPoint& dstPoint); + const SkIPoint& dstPoint, + uint32_t pixelOpsFlags = 0); /** Helper that copies the whole surface but fails when the two surfaces are not identically sized. */ bool copySurface(GrSurface* dst, GrSurface* src) { - return this->copySurface(dst, src, SkIRect::MakeWH(dst->width(), dst->height()), - SkIPoint::Make(0,0)); + if (NULL == dst || NULL == src || dst->width() != src->width() || + dst->height() != src->height()) { + return false; + } + this->copySurface(dst, src, SkIRect::MakeWH(dst->width(), dst->height()), + SkIPoint::Make(0,0)); + return true; } /** |