aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawTarget.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-02-16 07:34:17 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-16 07:34:17 -0800
commitb8fea97a7a493897fcff33aa2932d875c572f163 (patch)
tree9f9e0dadceb45df67b017c4d76c3144f3c01dac9 /src/gpu/GrDrawTarget.cpp
parent9dec5d2acdd12202a1f0ed571cb5ecee574a2550 (diff)
Make copySurface work for texture dsts, return a bool, & add unit test.
Diffstat (limited to 'src/gpu/GrDrawTarget.cpp')
-rw-r--r--src/gpu/GrDrawTarget.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index b9dc794526..9f15c11508 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -406,19 +406,21 @@ void GrDrawTarget::discard(GrRenderTarget* renderTarget) {
////////////////////////////////////////////////////////////////////////////////
-void GrDrawTarget::copySurface(GrSurface* dst,
+bool GrDrawTarget::copySurface(GrSurface* dst,
GrSurface* src,
const SkIRect& srcRect,
const SkIPoint& dstPoint) {
GrBatch* batch = GrCopySurfaceBatch::Create(dst, src, srcRect, dstPoint);
- if (batch) {
+ if (!batch) {
+ return false;
+ }
#ifdef ENABLE_MDB
- this->addDependency(src);
+ this->addDependency(src);
#endif
- this->recordBatch(batch);
- batch->unref();
- }
+ this->recordBatch(batch);
+ batch->unref();
+ return true;
}
template <class Left, class Right> static bool intersect(const Left& a, const Right& b) {