зеркало из https://github.com/mozilla/moz-skia.git
Revert of SkCanvas::clear() should call down to devices even when the clip is empty. (patchset #1 id:1 of https://codereview.chromium.org/735233003/)
Reason for revert: Chrome unit_tests failures on Mac & Win, blocking the roll: http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/5613 Original issue's description: > SkCanvas::clear() should call down to devices even when the clip is empty. > > SkDrawIter had a lovely, completely unused, option for this. Oversight? > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/378e70d8e561b72a904286ea231946f5c8345b9a TBR=reed@google.com,mtklein@google.com,mtklein@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/748733002
This commit is contained in:
Родитель
60b24d0df7
Коммит
8ebaa71712
|
@ -1707,7 +1707,7 @@ void SkCanvas::drawDRRect(const SkRRect& outer, const SkRRect& inner,
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void SkCanvas::clear(SkColor color) {
|
void SkCanvas::clear(SkColor color) {
|
||||||
SkDrawIter iter(this, false/*clear can affect empty clips*/);
|
SkDrawIter iter(this);
|
||||||
this->predrawNotify();
|
this->predrawNotify();
|
||||||
while (iter.next()) {
|
while (iter.next()) {
|
||||||
iter.fDevice->clear(color);
|
iter.fDevice->clear(color);
|
||||||
|
|
|
@ -795,17 +795,3 @@ DEF_TEST(Canvas, reporter) {
|
||||||
|
|
||||||
test_newraster(reporter);
|
test_newraster(reporter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure SkCanvas passes clear() calls down to its devices even when they're clipped out.
|
|
||||||
DEF_TEST(Canvas_clear, reporter) {
|
|
||||||
SkBitmap bm;
|
|
||||||
bm.allocN32Pixels(1,1);
|
|
||||||
|
|
||||||
SkCanvas canvas(bm);
|
|
||||||
canvas.clear(SK_ColorRED);
|
|
||||||
REPORTER_ASSERT(reporter, SK_ColorRED == bm.getColor(0,0));
|
|
||||||
|
|
||||||
canvas.clipRect(SkRect::MakeEmpty());
|
|
||||||
canvas.clear(SK_ColorGREEN);
|
|
||||||
REPORTER_ASSERT(reporter, SK_ColorGREEN == bm.getColor(0,0));
|
|
||||||
}
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче