[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
eric at webkit.org
eric at webkit.org
Wed Apr 7 23:48:06 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 6593b196d97e8708fc60abba44a211a5546bf814
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Nov 19 00:43:58 2009 +0000
2009-11-18 Shinichiro Hamaji <hamaji at chromium.org>
Reviewed by Dimitri Glazkov.
Win chromium is slow to draw transparent texts
https://bugs.webkit.org/show_bug.cgi?id=31258
Create bounded transparency layers instead of just clipping.
No new tests because this is just a performance improvement.
* platform/graphics/chromium/FontChromiumWin.cpp:
(WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::initializeForGDI):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 59cafd2..21bd5ef 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2009-11-18 Shinichiro Hamaji <hamaji at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Win chromium is slow to draw transparent texts
+ https://bugs.webkit.org/show_bug.cgi?id=31258
+
+ Create bounded transparency layers instead of just clipping.
+
+ No new tests because this is just a performance improvement.
+
+ * platform/graphics/chromium/FontChromiumWin.cpp:
+ (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::initializeForGDI):
+
2009-11-18 Shu Chang <Chang.Shu at nokia.com>
Reviewed by Eric Seidel.
diff --git a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
index daea76d..9f8f354 100644
--- a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
@@ -114,11 +114,14 @@ void TransparencyAwareFontPainter::initializeForGDI()
{
m_graphicsContext->save();
SkColor color = m_platformContext->effectiveFillColor();
+ // Used only when m_createdTransparencyLayer is true.
+ float layerAlpha = 0.0f;
if (SkColorGetA(color) != 0xFF) {
// When the font has some transparency, apply it by creating a new
- // transparency layer with that opacity applied.
+ // transparency layer with that opacity applied. We'll actually create
+ // a new transparency layer after we calculate the bounding box.
m_createdTransparencyLayer = true;
- m_graphicsContext->beginTransparencyLayer(SkColorGetA(color) / 255.0f);
+ layerAlpha = SkColorGetA(color) / 255.0f;
// The color should be opaque now.
color = SkColorSetRGB(SkColorGetR(color), SkColorGetG(color), SkColorGetB(color));
}
@@ -133,17 +136,21 @@ void TransparencyAwareFontPainter::initializeForGDI()
layerMode = TransparencyWin::TextComposite;
layerRect = estimateTextBounds();
m_graphicsContext->clip(layerRect);
+ if (m_createdTransparencyLayer)
+ m_graphicsContext->beginTransparencyLayer(layerAlpha);
// The transparency helper requires that we draw text in black in
// this mode and it will apply the color.
m_transparency.setTextCompositeColor(color);
color = SkColorSetRGB(0, 0, 0);
- } else if (canvasHasMultipleLayers(m_platformContext->canvas())) {
+ } else if (m_createdTransparencyLayer || canvasHasMultipleLayers(m_platformContext->canvas())) {
// When we're drawing a web page, we know the background is opaque,
// but if we're drawing to a layer, we still need extra work.
layerMode = TransparencyWin::OpaqueCompositeLayer;
layerRect = estimateTextBounds();
m_graphicsContext->clip(layerRect);
+ if (m_createdTransparencyLayer)
+ m_graphicsContext->beginTransparencyLayer(layerAlpha);
} else {
// Common case of drawing onto the bottom layer of a web page: we
// know everything is opaque so don't need to do anything special.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list