diff options
author | 2016-02-16 07:34:17 -0800 | |
---|---|---|
committer | 2016-02-16 07:34:17 -0800 | |
commit | b8fea97a7a493897fcff33aa2932d875c572f163 (patch) | |
tree | 9f9e0dadceb45df67b017c4d76c3144f3c01dac9 /src/gpu/GrDrawTarget.cpp | |
parent | 9dec5d2acdd12202a1f0ed571cb5ecee574a2550 (diff) |
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
Review URL: https://codereview.chromium.org/1684313002
Diffstat (limited to 'src/gpu/GrDrawTarget.cpp')
-rw-r--r-- | src/gpu/GrDrawTarget.cpp | 14 |
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) { |