m_layerImage = ScratchBuffer::shared().getScratchBuffer(layerRect.size());
GraphicsContext* shadowContext = m_layerImage->context();
+#if ENABLE(TIZEN_CAIROGLES_IMAGE_CACHE)
+ context->platformContext()->setIsShadowContext(true);
+#endif
shadowContext->save();
// Add a pixel to avoid later edge aliasing when rotated.
context->clearShadow();
context->drawImageBuffer(m_layerImage, ColorSpaceDeviceRGB, roundedIntPoint(m_layerOrigin), IntRect(0, 0, m_layerSize.width(), m_layerSize.height()), context->compositeOperation());
+#if ENABLE(TIZEN_CAIROGLES_IMAGE_CACHE)
+ context->platformContext()->setIsShadowContext(false);
+#endif
m_layerImage = 0;
ScratchBuffer::shared().scheduleScratchBufferPurge();
{
BackingStoreCopy copyMode = destinationContext == context() ? CopyBackingStore : DontCopyBackingStore;
RefPtr<Image> image = copyImage(copyMode);
+#if ENABLE(TIZEN_CAIROGLES_IMAGE_CACHE)
+ if (cairo_surface_get_type(m_data.m_surface) == CAIRO_SURFACE_TYPE_GL && copyMode == CopyBackingStore)
+ destinationContext->platformContext()->setIsDrawSelfContext(true);
+#endif
destinationContext->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, DoNotRespectImageOrientation, useLowQualityScale);
+#if ENABLE(TIZEN_CAIROGLES_IMAGE_CACHE)
+ if (cairo_surface_get_type(m_data.m_surface) == CAIRO_SURFACE_TYPE_GL && copyMode == CopyBackingStore)
+ destinationContext->platformContext()->setIsDrawSelfContext(false);
+#endif
}
void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
PlatformContextCairo::PlatformContextCairo(cairo_t* cr)
: m_cr(cr)
+#if ENABLE(TIZEN_CAIROGLES_IMAGE_CACHE)
+ , m_shadowContext(false)
+ , m_selfContext(false)
+#endif
{
m_stateStack.append(State());
m_state = &m_stateStack.last();
snapshot = 0;
}
- if (!snapshot) {
+ if (!snapshot && !isShadowContext() && !isDrawSelfContext()) {
int w = cairo_image_surface_get_width(surface);
int h = cairo_image_surface_get_height(surface);
#if ENABLE(TIZEN_CAIROGLES_IMAGE_AUTOSCALE)
enum AlphaPreservation { DoNotPreserveAlpha, PreserveAlpha };
void prepareForStroking(const GraphicsContextState&, AlphaPreservation = PreserveAlpha);
+#if ENABLE(TIZEN_CAIROGLES_IMAGE_CACHE)
+ void setIsShadowContext(bool isShadowContext) { m_shadowContext = isShadowContext; }
+ bool isShadowContext() const { return m_shadowContext; }
+
+ void setIsDrawSelfContext(bool isDrawSelfContext) { m_selfContext = isDrawSelfContext; }
+ bool isDrawSelfContext() const { return m_selfContext; }
+#endif
+
private:
void clipForPatternFilling(const GraphicsContextState&);
// GraphicsContext is responsible for managing the state of the ShadowBlur,
// so it does not need to be on the state stack.
ShadowBlur m_shadowBlur;
+#if ENABLE(TIZEN_CAIROGLES_IMAGE_CACHE)
+ bool m_shadowContext;
+ bool m_selfContext;
+#endif
};