| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Simon Hausmann <hausmann@kde.org> | 3 * (C) 2000 Simon Hausmann <hausmann@kde.org> |
| 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
| 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 FloatRect replacementTextRect; | 156 FloatRect replacementTextRect; |
| 157 Font font; | 157 Font font; |
| 158 TextRun run(""); | 158 TextRun run(""); |
| 159 float textWidth; | 159 float textWidth; |
| 160 if (!getReplacementTextGeometry(paintOffset, contentRect, path, replacementT
extRect, font, run, textWidth)) | 160 if (!getReplacementTextGeometry(paintOffset, contentRect, path, replacementT
extRect, font, run, textWidth)) |
| 161 return; | 161 return; |
| 162 | 162 |
| 163 GraphicsContextStateSaver stateSaver(*context); | 163 GraphicsContextStateSaver stateSaver(*context); |
| 164 context->clip(contentRect); | 164 context->clip(contentRect); |
| 165 context->setAlpha(replacementTextRoundedRectOpacity); | 165 context->setAlpha(replacementTextRoundedRectOpacity); |
| 166 context->setFillColor(Color::white, style()->colorSpace()); | 166 context->setFillColor(Color::white); |
| 167 context->fillPath(path); | 167 context->fillPath(path); |
| 168 | 168 |
| 169 const FontMetrics& fontMetrics = font.fontMetrics(); | 169 const FontMetrics& fontMetrics = font.fontMetrics(); |
| 170 float labelX = roundf(replacementTextRect.location().x() + (replacementTextR
ect.size().width() - textWidth) / 2); | 170 float labelX = roundf(replacementTextRect.location().x() + (replacementTextR
ect.size().width() - textWidth) / 2); |
| 171 float labelY = roundf(replacementTextRect.location().y() + (replacementTextR
ect.size().height() - fontMetrics.height()) / 2 + fontMetrics.ascent()); | 171 float labelY = roundf(replacementTextRect.location().y() + (replacementTextR
ect.size().height() - fontMetrics.height()) / 2 + fontMetrics.ascent()); |
| 172 TextRunPaintInfo runInfo(run); | 172 TextRunPaintInfo runInfo(run); |
| 173 runInfo.bounds = replacementTextRect; | 173 runInfo.bounds = replacementTextRect; |
| 174 context->setAlpha(replacementTextTextOpacity); | 174 context->setAlpha(replacementTextTextOpacity); |
| 175 context->setFillColor(Color::black, style()->colorSpace()); | 175 context->setFillColor(Color::black); |
| 176 context->drawBidiText(font, runInfo, FloatPoint(labelX, labelY)); | 176 context->drawBidiText(font, runInfo, FloatPoint(labelX, labelY)); |
| 177 } | 177 } |
| 178 | 178 |
| 179 bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumul
atedOffset, FloatRect& contentRect, Path& path, FloatRect& replacementTextRect,
Font& font, TextRun& run, float& textWidth) const | 179 bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumul
atedOffset, FloatRect& contentRect, Path& path, FloatRect& replacementTextRect,
Font& font, TextRun& run, float& textWidth) const |
| 180 { | 180 { |
| 181 contentRect = contentBoxRect(); | 181 contentRect = contentBoxRect(); |
| 182 contentRect.moveBy(roundedIntPoint(accumulatedOffset)); | 182 contentRect.moveBy(roundedIntPoint(accumulatedOffset)); |
| 183 | 183 |
| 184 FontDescription fontDescription; | 184 FontDescription fontDescription; |
| 185 RenderTheme::defaultTheme()->systemFont(CSSValueWebkitSmallControl, fontDesc
ription); | 185 RenderTheme::defaultTheme()->systemFont(CSSValueWebkitSmallControl, fontDesc
ription); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 { | 289 { |
| 290 return false; | 290 return false; |
| 291 } | 291 } |
| 292 | 292 |
| 293 bool RenderEmbeddedObject::canHaveChildren() const | 293 bool RenderEmbeddedObject::canHaveChildren() const |
| 294 { | 294 { |
| 295 return false; | 295 return false; |
| 296 } | 296 } |
| 297 | 297 |
| 298 } | 298 } |
| OLD | NEW |