#if ENABLE(TIZEN_WEBKIT2)
#define ENABLE_TIZEN_MOBILE_WEB_PRINT 1 /* Hyunsoo Shim(hyunsoo.shim@samsung.com) : Mobile Web Print for AC layer */
+#define ENABLE_TIZEN_EMULATOR_CONTEXT_ERROR_WORKAROUND 1 /* YongGeol Jung(yg48.jung@samsung.com) : eglMakeCurrent should be called before glReadPixels(emulator issue).*/
#endif
#define ENABLE_TIZEN_CSS_FIXED_ACCELERATION 1 /* Jaehun Lim(ljaehun.lim@samsung.com) : Accelerated CSS FIXED elements */
#if ENABLE(OVERFLOW_SCROLLING)
}
#endif
#if ENABLE(TIZEN_WEBKIT2)
-bool GraphicsContext3DOffscreen::makeContextCurrent() {
-
+bool GraphicsContext3DOffscreen::makeContextCurrent()
+{
if (eglGetCurrentSurface(EGL_READ) == m_surface && eglGetCurrentContext() == m_context)
return true;
return eglMakeCurrent(m_display, m_surface, m_surface, m_context);
}
+
+#if ENABLE(TIZEN_EMULATOR_CONTEXT_ERROR_WORKAROUND)
+bool GraphicsContext3DOffscreen::forceMakeContextCurrent()
+{
+ return eglMakeCurrent(m_display, m_surface, m_surface, m_context);
+}
+#endif
#endif
bool GraphicsContext3DOffscreen::paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, int canvasWidth, int canvasHeight, PlatformContextCairo* context)
if (pixelsSize < totalBytes)
return;
+#if ENABLE(TIZEN_WEBKIT2) && ENABLE(TIZEN_EMULATOR_CONTEXT_ERROR_WORKAROUND)
+ // FIXME: eglMakeCurrent should be called before glReadPixels(emulator issue).
+ forceMakeContextCurrent();
+#else
makeContextCurrent();
+#endif
bool mustRestoreFBO = false;
if (m_attributes.antialias)
#if ENABLE(TIZEN_WEBKIT2)
virtual bool makeContextCurrent();
+#if ENABLE(TIZEN_EMULATOR_CONTEXT_ERROR_WORKAROUND)
+ bool forceMakeContextCurrent();
+#endif
#endif
virtual void prepareTexture(int width, int height);