summaryrefslogtreecommitdiff
path: root/Source/WebCore/platform/graphics/qt
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/qt')
-rw-r--r--Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp35
-rw-r--r--Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp1
2 files changed, 28 insertions, 8 deletions
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 260081946..1e041050e 100644
--- a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -358,7 +358,7 @@ void GraphicsContext::restorePlatformState()
{
if (!m_data->layers.isEmpty() && !m_data->layers.top()->alphaMask.isNull())
if (!--m_data->layers.top()->saveCounter)
- endPlatformTransparencyLayer();
+ popTransparencyLayerInternal();
m_data->p()->restore();
}
@@ -1313,18 +1313,39 @@ void GraphicsContext::beginPlatformTransparencyLayer(float opacity)
++m_data->layerCount;
}
+void GraphicsContext::popTransparencyLayerInternal()
+{
+ TransparencyLayer* layer = m_data->layers.pop();
+ ASSERT(!layer->alphaMask.isNull());
+ ASSERT(layer->saveCounter == 0);
+ layer->painter.resetTransform();
+ layer->painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
+ layer->painter.drawPixmap(QPoint(), layer->alphaMask);
+ layer->painter.end();
+
+ QPainter* p = m_data->p();
+ p->save();
+ p->resetTransform();
+ p->setOpacity(layer->opacity);
+ p->drawPixmap(layer->offset, layer->pixmap);
+ p->restore();
+
+ delete layer;
+}
+
void GraphicsContext::endPlatformTransparencyLayer()
{
if (paintingDisabled())
return;
+ while ( ! m_data->layers.top()->alphaMask.isNull() ){
+ --m_data->layers.top()->saveCounter;
+ popTransparencyLayerInternal();
+ if (m_data->layers.isEmpty())
+ return;
+ }
TransparencyLayer* layer = m_data->layers.pop();
- if (!layer->alphaMask.isNull()) {
- layer->painter.resetTransform();
- layer->painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
- layer->painter.drawPixmap(QPoint(), layer->alphaMask);
- } else
- --m_data->layerCount; // see the comment for layerCount
+ --m_data->layerCount; // see the comment for layerCount
layer->painter.end();
QPainter* p = m_data->p();
diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index 2295362aa..af798f761 100644
--- a/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -34,7 +34,6 @@
#include "IntRect.h"
#include "MIMETypeRegistry.h"
#include "StillImageQt.h"
-#include "TransparencyLayer.h"
#include <runtime/JSCInlines.h>
#include <runtime/TypedArrayInlines.h>
#include <wtf/text/WTFString.h>