Remove temporary_internal_describeTopLayer
Change-Id: I035b7db84b524be13fb675b75bc402bc9b733cb5 Reviewed-on: https://skia-review.googlesource.com/13803 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
This commit is contained in:
parent
2a475eae62
commit
135c908812
@ -1279,12 +1279,6 @@ public:
|
||||
const SkPaint* paint,
|
||||
SrcRectConstraint constraint = kStrict_SrcRectConstraint);
|
||||
|
||||
// expose minimum amount of information necessary for transitional refactoring
|
||||
/**
|
||||
* Returns CTM and clip bounds, translated from canvas coordinates to top layer coordinates.
|
||||
*/
|
||||
void temporary_internal_describeTopLayer(SkMatrix* matrix, SkIRect* clip_bounds);
|
||||
|
||||
/**
|
||||
* Returns the global clip as a region. If the clip contains AA, then only the bounds
|
||||
* of the clip may be returned.
|
||||
|
@ -1930,18 +1930,6 @@ void SkCanvas::legacy_drawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
|
||||
}
|
||||
}
|
||||
|
||||
void SkCanvas::temporary_internal_describeTopLayer(SkMatrix* matrix, SkIRect* clip_bounds) {
|
||||
SkIRect layer_bounds = this->getTopLayerBounds();
|
||||
if (matrix) {
|
||||
*matrix = this->getTotalMatrix();
|
||||
matrix->preTranslate(-layer_bounds.left(), -layer_bounds.top());
|
||||
}
|
||||
if (clip_bounds) {
|
||||
*clip_bounds = this->getDeviceClipBounds();
|
||||
clip_bounds->offset(-layer_bounds.left(), -layer_bounds.top());
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// These are the virtual drawing methods
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -541,45 +541,6 @@ static void NestedSaveRestoreWithFlushTestStep(SkCanvas* canvas, const TestData&
|
||||
}
|
||||
TEST_STEP(NestedSaveRestoreWithFlush, NestedSaveRestoreWithFlushTestStep);
|
||||
|
||||
static void DescribeTopLayerTestStep(SkCanvas* canvas,
|
||||
const TestData& d,
|
||||
skiatest::Reporter* reporter,
|
||||
CanvasTestStep* testStep) {
|
||||
SkMatrix m;
|
||||
SkIRect r;
|
||||
// NOTE: adjustToTopLayer() does *not* reduce the clip size, even if the canvas
|
||||
// is smaller than 10x10!
|
||||
|
||||
canvas->temporary_internal_describeTopLayer(&m, &r);
|
||||
REPORTER_ASSERT_MESSAGE(reporter, m.isIdentity(), testStep->assertMessage());
|
||||
REPORTER_ASSERT_MESSAGE(reporter, r == SkIRect::MakeXYWH(0, 0, 2, 2),
|
||||
testStep->assertMessage());
|
||||
|
||||
// Putting a full-canvas layer on it should make no change to the results.
|
||||
SkRect layerBounds = SkRect::MakeXYWH(0.f, 0.f, 10.f, 10.f);
|
||||
canvas->saveLayer(layerBounds, nullptr);
|
||||
canvas->temporary_internal_describeTopLayer(&m, &r);
|
||||
REPORTER_ASSERT_MESSAGE(reporter, m.isIdentity(), testStep->assertMessage());
|
||||
REPORTER_ASSERT_MESSAGE(reporter, r == SkIRect::MakeXYWH(0, 0, 2, 2),
|
||||
testStep->assertMessage());
|
||||
canvas->restore();
|
||||
|
||||
// Adding a translated layer translates the results.
|
||||
// Default canvas is only 2x2, so can't offset our layer by very much at all;
|
||||
// saveLayer() aborts if the bounds don't intersect.
|
||||
layerBounds = SkRect::MakeXYWH(1.f, 1.f, 6.f, 6.f);
|
||||
canvas->saveLayer(layerBounds, nullptr);
|
||||
canvas->temporary_internal_describeTopLayer(&m, &r);
|
||||
REPORTER_ASSERT_MESSAGE(reporter, m == SkMatrix::MakeTrans(-1.f, -1.f),
|
||||
testStep->assertMessage());
|
||||
REPORTER_ASSERT_MESSAGE(reporter, r == SkIRect::MakeXYWH(0, 0, 1, 1),
|
||||
testStep->assertMessage());
|
||||
canvas->restore();
|
||||
|
||||
}
|
||||
TEST_STEP(DescribeTopLayer, DescribeTopLayerTestStep);
|
||||
|
||||
|
||||
static void TestPdfDevice(skiatest::Reporter* reporter, const TestData& d, CanvasTestStep* step) {
|
||||
SkDynamicMemoryWStream outStream;
|
||||
sk_sp<SkDocument> doc(SkDocument::MakePDF(&outStream));
|
||||
|
Loading…
Reference in New Issue
Block a user