diff options
author | 2017-02-17 14:38:11 -0500 | |
---|---|---|
committer | 2017-02-17 21:03:43 +0000 | |
commit | c5e641cc9947b8b2d3c63f908c7b98fa5b3d0f07 (patch) | |
tree | b17cc0ae0a104ec61876ea932fc3bc4be96b73be /src/gpu/SkGpuDevice.cpp | |
parent | 9c58306f87ff342bf30ed645be3332aa6f2b2fee (diff) |
use common intermediate device class for clipstack management
BUG=skia:6214
Change-Id: I64b849ad7c8dafe423e24e6fccfb3f0c1d096ab0
Reviewed-on: https://skia-review.googlesource.com/8669
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 791d4353c7..6ab2d60b91 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -238,7 +238,7 @@ void SkGpuDevice::prepareDraw(const SkDraw& draw) { #ifdef SK_USE_DEVICE_CLIPPING SkASSERT(*draw.fMatrix == this->ctm()); - fClip.reset(&fClipStack, nullptr); + fClip.reset(&this->cs(), nullptr); #else fClip.reset(draw.fClipStack, &this->getOrigin()); #endif @@ -1825,54 +1825,4 @@ SkImageFilterCache* SkGpuDevice::getImageFilterCache() { return SkImageFilterCache::Create(SkImageFilterCache::kDefaultTransientSize); } -/////////////////////////////////////////////////////////////////////////////////////////////////// - -void SkGpuDevice::onSave() { - fClipStack.save(); -} - -void SkGpuDevice::onRestore() { - fClipStack.restore(); -} - -void SkGpuDevice::onClipRect(const SkRect& rect, SkClipOp op, bool aa) { - fClipStack.clipRect(rect, this->ctm(), op, aa); -} - -void SkGpuDevice::onClipRRect(const SkRRect& rrect, SkClipOp op, bool aa) { - fClipStack.clipRRect(rrect, this->ctm(), op, aa); -} - -void SkGpuDevice::onClipPath(const SkPath& path, SkClipOp op, bool aa) { - fClipStack.clipPath(path, this->ctm(), op, aa); -} - -void SkGpuDevice::onClipRegion(const SkRegion& rgn, SkClipOp op) { - SkIPoint origin = this->getOrigin(); - SkRegion tmp; - const SkRegion* ptr = &rgn; - if (origin.fX | origin.fY) { - // translate from "global/canvas" coordinates to relative to this device - rgn.translate(-origin.fX, -origin.fY, &tmp); - ptr = &tmp; - } - fClipStack.clipDevRect(ptr->getBounds(), op); -} - -void SkGpuDevice::onSetDeviceClipRestriction(SkIRect* clipRestriction) { - if (clipRestriction->isEmpty()) { - fClipStack.setDeviceClipRestriction(*clipRestriction); - } else { - SkIPoint origin = this->getOrigin(); - SkIRect rect = clipRestriction->makeOffset(-origin.x(), -origin.y()); - fClipStack.setDeviceClipRestriction(rect); - fClipStack.clipDevRect(rect, SkClipOp::kIntersect); - } -} - -void SkGpuDevice::validateDevBounds(const SkIRect& drawClipBounds) { -#ifdef SK_DEBUG -#endif -} - #endif |