experimental/editor: minor change

Change-Id: Ifd3963e6bb337832c287f2b0553315828a5d3889
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216350
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This commit is contained in:
Hal Canary 2019-05-28 12:01:06 -04:00 committed by Skia Commit-Bot
parent 53146121b8
commit 308adbb418
2 changed files with 5 additions and 1 deletions

View File

@ -321,6 +321,9 @@ static inline SkRect offset(SkRect r, SkIPoint p) {
void Editor::paint(SkCanvas* c, PaintOpts options) {
this->reshapeAll();
if (!c) {
return;
}
c->drawPaint(SkPaint(options.fBackgroundColor));

View File

@ -110,7 +110,6 @@ struct EditorLayer : public sk_app::Window::Layer {
fHeight = height;
if (width != fWidth) {
fWidth = width;
Timer timer("shaping");
fEditor.setWidth(fWidth);
}
this->inval();
@ -235,6 +234,8 @@ struct EditorApplication : public sk_app::Application {
fWindow->pushLayer(&fLayer);
fWindow->show();
fLayer.onResize(fWindow->width(), fWindow->height());
Timer timer("shaping");
fLayer.fEditor.paint(nullptr, editor::Editor::PaintOpts());
}
~EditorApplication() override { fWindow->detach(); }