summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/WebFontImpl.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
commit2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch)
tree988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebKit/chromium/src/WebFontImpl.cpp
parentdd91e772430dc294e3bf478c119ef8d43c0a3358 (diff)
downloadqtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebKit/chromium/src/WebFontImpl.cpp')
-rw-r--r--Source/WebKit/chromium/src/WebFontImpl.cpp31
1 files changed, 13 insertions, 18 deletions
diff --git a/Source/WebKit/chromium/src/WebFontImpl.cpp b/Source/WebKit/chromium/src/WebFontImpl.cpp
index c92a1f567..f6cf39dbe 100644
--- a/Source/WebKit/chromium/src/WebFontImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFontImpl.cpp
@@ -113,24 +113,19 @@ void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFl
gc.restore();
#if defined(WIN32)
- if (canvasIsOpaque && SkColorGetA(color) == 0xFF) {
- SkCanvas::LayerIter iter(const_cast<SkCanvas*>(canvas), false);
- iter.next(); // There is always at least one layer.
- bool multipleLayers = !iter.done();
- if (!multipleLayers) {
- // The text drawing logic on Windows ignores the alpha component
- // intentionally, for performance reasons.
- // (Please see TransparencyAwareFontPainter::initializeForGDI in
- // FontChromiumWin.cpp.)
- const SkBitmap& bitmap = canvas->getTopDevice()->accessBitmap(true);
- IntRect textBounds = estimateTextBounds(run, leftBaseline);
- IntRect destRect = gc.getCTM().mapRect(textBounds);
- destRect.intersect(IntRect(0, 0, bitmap.width(), bitmap.height()));
- for (int y = destRect.y(), maxY = destRect.maxY(); y < maxY; y++) {
- uint32_t* row = bitmap.getAddr32(0, y);
- for (int x = destRect.x(), maxX = destRect.maxX(); x < maxX; x++)
- row[x] |= (0xFF << SK_A32_SHIFT);
- }
+ if (canvasIsOpaque && SkColorGetA(color) == 0xFF && !canvas->isDrawingToLayer()) {
+ // The text drawing logic on Windows ignores the alpha component
+ // intentionally, for performance reasons.
+ // (Please see TransparencyAwareFontPainter::initializeForGDI in
+ // FontChromiumWin.cpp.)
+ const SkBitmap& bitmap = canvas->getTopDevice()->accessBitmap(true);
+ IntRect textBounds = estimateTextBounds(run, leftBaseline);
+ IntRect destRect = gc.getCTM().mapRect(textBounds);
+ destRect.intersect(IntRect(0, 0, bitmap.width(), bitmap.height()));
+ for (int y = destRect.y(), maxY = destRect.maxY(); y < maxY; y++) {
+ uint32_t* row = bitmap.getAddr32(0, y);
+ for (int x = destRect.x(), maxX = destRect.maxX(); x < maxX; x++)
+ row[x] |= (0xFF << SK_A32_SHIFT);
}
}
#endif