Extra checks for an initialized SkiaDisplay for GPU support on OS X

This commit is contained in:
David Capello 2016-04-13 10:17:59 -03:00
parent 99d7eb5391
commit b0f53324a7

View File

@ -139,7 +139,7 @@ public:
}
#if SK_SUPPORT_GPU
if (m_glCtx)
if (m_glCtx && m_display->isInitialized())
createRenderTarget(size);
#endif
@ -149,7 +149,7 @@ public:
void onDrawRect(const gfx::Rect& rect) override {
#if SK_SUPPORT_GPU
// Flush operations to the SkCanvas
{
if (m_display->isInitialized()) {
SkiaSurface* surface = static_cast<SkiaSurface*>(m_display->getSurface());
surface->flush();
}