diff options
author | kjlubick <kjlubick@google.com> | 2016-02-11 12:05:24 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-11 12:05:24 -0800 |
commit | 0eed945294fa0b2dee7d971c16dc9beefab2ec1c (patch) | |
tree | 3eab5f804aa31631465e6955b8eec9d43896674f /include | |
parent | 27004b7e653a38570d3fd1621ed0107e5443b31a (diff) |
Revert of Make copySurface work for texture dsts, return a bool, & add unit test. (patchset #6 id:100001 of https://codereview.chromium.org/1684313002/ )
Reason for revert:
Copy surface tests are not happy for Windows, Android and probably others:
https://uberchromegw.corp.google.com/i/client.skia.android/builders/Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release/builds/4161
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Win8-MSVC-ShuttleA-GPU-GTX960-x86_64-Release/builds/3694
Original issue's description:
> Make copySurface work for texture dsts, return a bool, & add unit test.
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1684313002
>
> Committed: https://skia.googlesource.com/skia/+/7ea5e28065e5eb797e95f5d81c1a65cf3209d741
TBR=robertphillips@google.com,bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1690053002
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrContext.h | 15 | ||||
-rw-r--r-- | include/gpu/GrDrawContext.h | 2 |
2 files changed, 12 insertions, 5 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; } /** diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h index 4c884154e3..24e38b8494 100644 --- a/include/gpu/GrDrawContext.h +++ b/include/gpu/GrDrawContext.h @@ -47,7 +47,7 @@ class SK_API GrDrawContext : public SkRefCnt { public: ~GrDrawContext() override; - bool copySurface(GrSurface* src, const SkIRect& srcRect, const SkIPoint& dstPoint); + void copySurface(GrSurface* src, const SkIRect& srcRect, const SkIPoint& dstPoint); // TODO: it is odd that we need both the SkPaint in the following 3 methods. // We should extract the text parameters from SkPaint and pass them separately |