SkColorSpaceXformCanvas: setMatrix(), clipRect() in constructor

BUG=703363
Change-Id: Ie0053940dd041614b93400e34145118fb0742cae

Change-Id: Ie0053940dd041614b93400e34145118fb0742cae
Reviewed-on: https://skia-review.googlesource.com/10806
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This commit is contained in:
Matt Sarett 2017-03-30 17:23:48 -04:00 committed by Skia Commit-Bot
parent b48df27951
commit 9969e77141

View File

@ -21,7 +21,13 @@ public:
: SkNoDrawCanvas(SkIRect::MakeSize(target->getBaseLayerSize()))
, fTarget(target)
, fXformer(std::move(xformer))
{}
{
// Set the matrix and clip to match |fTarget|. Otherwise, we'll answer queries for
// bounds/matrix differently than |fTarget| would.
SkCanvas::onClipRect(SkRect::MakeFromIRect(fTarget->getDeviceClipBounds()),
SkClipOp::kIntersect, kHard_ClipEdgeStyle);
SkCanvas::setMatrix(fTarget->getTotalMatrix());
}
SkImageInfo onImageInfo() const override {
return fTarget->imageInfo();