aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/batches
diff options
context:
space:
mode:
authorGravatar kjlubick <kjlubick@google.com>2016-02-11 12:05:24 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-11 12:05:24 -0800
commit0eed945294fa0b2dee7d971c16dc9beefab2ec1c (patch)
tree3eab5f804aa31631465e6955b8eec9d43896674f /src/gpu/batches
parent27004b7e653a38570d3fd1621ed0107e5443b31a (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 'src/gpu/batches')
-rw-r--r--src/gpu/batches/GrCopySurfaceBatch.cpp19
-rw-r--r--src/gpu/batches/GrCopySurfaceBatch.h10
2 files changed, 12 insertions, 17 deletions
diff --git a/src/gpu/batches/GrCopySurfaceBatch.cpp b/src/gpu/batches/GrCopySurfaceBatch.cpp
index a59ed38f51..098f7c7704 100644
--- a/src/gpu/batches/GrCopySurfaceBatch.cpp
+++ b/src/gpu/batches/GrCopySurfaceBatch.cpp
@@ -9,12 +9,12 @@
#include "GrCopySurfaceBatch.h"
// returns true if the read/written rect intersects the src/dst and false if not.
-bool GrCopySurfaceBatch::ClipSrcRectAndDstPoint(const GrSurface* dst,
- const GrSurface* src,
- const SkIRect& srcRect,
- const SkIPoint& dstPoint,
- SkIRect* clippedSrcRect,
- SkIPoint* clippedDstPoint) {
+static bool clip_srcrect_and_dstpoint(const GrSurface* dst,
+ const GrSurface* src,
+ const SkIRect& srcRect,
+ const SkIPoint& dstPoint,
+ SkIRect* clippedSrcRect,
+ SkIPoint* clippedDstPoint) {
*clippedSrcRect = srcRect;
*clippedDstPoint = dstPoint;
@@ -67,7 +67,12 @@ GrBatch* GrCopySurfaceBatch::Create(GrSurface* dst, GrSurface* src, const SkIRec
SkIRect clippedSrcRect;
SkIPoint clippedDstPoint;
// If the rect is outside the src or dst then we've already succeeded.
- if (!ClipSrcRectAndDstPoint(dst, src, srcRect, dstPoint, &clippedSrcRect, &clippedDstPoint)) {
+ if (!clip_srcrect_and_dstpoint(dst,
+ src,
+ srcRect,
+ dstPoint,
+ &clippedSrcRect,
+ &clippedDstPoint)) {
return nullptr;
}
return new GrCopySurfaceBatch(dst, src, clippedSrcRect, clippedDstPoint);
diff --git a/src/gpu/batches/GrCopySurfaceBatch.h b/src/gpu/batches/GrCopySurfaceBatch.h
index 3926643f8a..7bf8d8d8c2 100644
--- a/src/gpu/batches/GrCopySurfaceBatch.h
+++ b/src/gpu/batches/GrCopySurfaceBatch.h
@@ -17,16 +17,6 @@ class GrCopySurfaceBatch final : public GrBatch {
public:
DEFINE_BATCH_CLASS_ID
- /** This should not really be exposed as Create() will apply this clipping, but there is
- * currently a workaround in GrContext::copySurface() for non-render target dsts that relies
- * on it. */
- static bool ClipSrcRectAndDstPoint(const GrSurface* dst,
- const GrSurface* src,
- const SkIRect& srcRect,
- const SkIPoint& dstPoint,
- SkIRect* clippedSrcRect,
- SkIPoint* clippedDstPoint);
-
static GrBatch* Create(GrSurface* dst, GrSurface* src, const SkIRect& srcRect,
const SkIPoint& dstPoint);