Moved "drawShadowedPicture" call outside of if cases in onDrawContent.

Bug description:
If you updated the view without changing frames (such as moving around the
cursor with 'z' (pixel zoom) on) the window would turn gray.

This was because I left the drawShadowedPicture call inside of the "if-updated"
case inside of SampleShadowing's onDrawContent handler.

If nothing changed and onDrawContent is called, we still need to update the
given canvas's fLights (there is no guarantee of whether the canvas (or its
fLights) has been updated or not), and then draw the shadowed picture.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2245923002

Review-Url: https://codereview.chromium.org/2245923002
This commit is contained in:
vjiaoblack 2016-08-16 05:38:45 -07:00 committed by Commit bot
parent c5064d9c3d
commit d707f2d1cf

View File

@ -116,10 +116,10 @@ protected:
fSceneChanged = false;
fLightsChanged = false;
fClearShadowMaps = false;
canvas->setLights(fLights);
canvas->drawShadowedPicture(fPicture, nullptr, nullptr);
}
canvas->setLights(fLights);
canvas->drawShadowedPicture(fPicture, nullptr, nullptr);
}
SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) override {