Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: trunk/Source/core/rendering/EllipsisBox.cpp

Issue 23507002: Revert 156733 "Refactoring DrawLooper so that it can apply shado..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2003, 2006 Apple Computer, Inc. 2 * Copyright (C) 2003, 2006 Apple Computer, Inc.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // Select the correct color for painting the text. 49 // Select the correct color for painting the text.
50 Color foreground = paintInfo.forceBlackText() ? Color::black : renderer( )->selectionForegroundColor(); 50 Color foreground = paintInfo.forceBlackText() ? Color::black : renderer( )->selectionForegroundColor();
51 if (foreground != Color::transparent && foreground != styleTextColor) 51 if (foreground != Color::transparent && foreground != styleTextColor)
52 context->setFillColor(foreground); 52 context->setFillColor(foreground);
53 } 53 }
54 54
55 // Text shadows are disabled when printing. http://crbug.com/258321 55 // Text shadows are disabled when printing. http://crbug.com/258321
56 const ShadowData* shadow = context->printing() ? 0 : style->textShadow(); 56 const ShadowData* shadow = context->printing() ? 0 : style->textShadow();
57 bool hasShadow = shadow; 57 bool hasShadow = shadow;
58 if (hasShadow) { 58 if (hasShadow) {
59 RefPtr<DrawLooper> drawLooper(new DrawLooper); 59 DrawLooper drawLooper;
60 do { 60 do {
61 int shadowX = isHorizontal() ? shadow->x() : shadow->y(); 61 int shadowX = isHorizontal() ? shadow->x() : shadow->y();
62 int shadowY = isHorizontal() ? shadow->y() : -shadow->x(); 62 int shadowY = isHorizontal() ? shadow->y() : -shadow->x();
63 FloatSize offset(shadowX, shadowY); 63 FloatSize offset(shadowX, shadowY);
64 drawLooper->addShadow(offset, shadow->blur(), 64 drawLooper.addShadow(offset, shadow->blur(),
65 m_renderer->resolveColor(shadow->color(), Color::stdShadowColor) , 65 m_renderer->resolveColor(shadow->color(), Color::stdShadowColor) ,
66 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresA lpha); 66 DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresA lpha);
67 } while ((shadow = shadow->next())); 67 } while ((shadow = shadow->next()));
68 drawLooper->addUnmodifiedContent(); 68 drawLooper.addUnmodifiedContent();
69 context->setDrawLooper(drawLooper.release()); 69 context->setDrawLooper(drawLooper);
70 } 70 }
71 71
72 // FIXME: Why is this always LTR? Fix by passing correct text run flags belo w. 72 // FIXME: Why is this always LTR? Fix by passing correct text run flags belo w.
73 FloatPoint boxOrigin(paintOffset); 73 FloatPoint boxOrigin(paintOffset);
74 boxOrigin.move(x(), y()); 74 boxOrigin.move(x(), y());
75 FloatRect boxRect(boxOrigin, LayoutSize(logicalWidth(), logicalHeight())); 75 FloatRect boxRect(boxOrigin, LayoutSize(logicalWidth(), logicalHeight()));
76 FloatPoint textOrigin(boxOrigin.x(), boxOrigin.y() + style->fontMetrics().as cent()); 76 FloatPoint textOrigin(boxOrigin.x(), boxOrigin.y() + style->fontMetrics().as cent());
77 TextRun textRun = RenderBlock::constructTextRun(renderer(), font, m_str, sty le, TextRun::AllowTrailingExpansion); 77 TextRun textRun = RenderBlock::constructTextRun(renderer(), font, m_str, sty le, TextRun::AllowTrailingExpansion);
78 TextRunPaintInfo textRunPaintInfo(textRun); 78 TextRunPaintInfo textRunPaintInfo(textRun);
79 textRunPaintInfo.bounds = boxRect; 79 textRunPaintInfo.bounds = boxRect;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 if (visibleToHitTestRequest(request) && boundsRect.intersects(HitTestLocatio n::rectForPoint(locationInContainer.point(), 0, 0, 0, 0))) { 169 if (visibleToHitTestRequest(request) && boundsRect.intersects(HitTestLocatio n::rectForPoint(locationInContainer.point(), 0, 0, 0, 0))) {
170 renderer()->updateHitTestResult(result, locationInContainer.point() - to LayoutSize(adjustedLocation)); 170 renderer()->updateHitTestResult(result, locationInContainer.point() - to LayoutSize(adjustedLocation));
171 if (!result.addNodeToRectBasedTestResult(renderer()->node(), request, lo cationInContainer, boundsRect)) 171 if (!result.addNodeToRectBasedTestResult(renderer()->node(), request, lo cationInContainer, boundsRect))
172 return true; 172 return true;
173 } 173 }
174 174
175 return false; 175 return false;
176 } 176 }
177 177
178 } // namespace WebCore 178 } // namespace WebCore
OLDNEW
« no previous file with comments | « trunk/Source/core/platform/graphics/skia/NativeImageSkia.cpp ('k') | trunk/Source/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698