Fix crash using an non-fully initialized SkiaDisplay on SkiaWindow::Impl::paintGC() on OS X

This commit is contained in:
David Capello 2016-04-13 10:16:06 -03:00
parent 2636401c1c
commit 99d7eb5391
2 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,7 @@ class SkiaDisplay : public Display {
public:
SkiaDisplay(int width, int height, int scale);
bool isInitialized() const { return m_initialized; }
void setSkiaSurface(SkiaSurface* surface);
void resetSkiaSurface();

View File

@ -272,6 +272,9 @@ private:
#endif
void paintGC(const gfx::Rect& rect) {
if (!m_display->isInitialized())
return;
SkiaSurface* surface = static_cast<SkiaSurface*>(m_display->getSurface());
const SkBitmap& bitmap = surface->bitmap();