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

Side by Side Diff: Source/core/rendering/RenderEmbeddedObject.cpp

Issue 14160005: Track the region where text is painted. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase with TOT Created 7 years, 8 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) 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 context->clip(contentRect); 198 context->clip(contentRect);
199 context->setAlpha(m_unavailablePluginIndicatorIsPressed ? replacementTextPre ssedRoundedRectOpacity : replacementTextRoundedRectOpacity); 199 context->setAlpha(m_unavailablePluginIndicatorIsPressed ? replacementTextPre ssedRoundedRectOpacity : replacementTextRoundedRectOpacity);
200 context->setFillColor(m_unavailablePluginIndicatorIsPressed ? replacementTex tRoundedRectPressedColor() : Color::white, style()->colorSpace()); 200 context->setFillColor(m_unavailablePluginIndicatorIsPressed ? replacementTex tRoundedRectPressedColor() : Color::white, style()->colorSpace());
201 context->fillPath(path); 201 context->fillPath(path);
202 202
203 const FontMetrics& fontMetrics = font.fontMetrics(); 203 const FontMetrics& fontMetrics = font.fontMetrics();
204 float labelX = roundf(replacementTextRect.location().x() + (replacementTextR ect.size().width() - textWidth) / 2); 204 float labelX = roundf(replacementTextRect.location().x() + (replacementTextR ect.size().width() - textWidth) / 2);
205 float labelY = roundf(replacementTextRect.location().y() + (replacementTextR ect.size().height() - fontMetrics.height()) / 2 + fontMetrics.ascent()); 205 float labelY = roundf(replacementTextRect.location().y() + (replacementTextR ect.size().height() - fontMetrics.height()) / 2 + fontMetrics.ascent());
206 context->setAlpha(m_unavailablePluginIndicatorIsPressed ? replacementTextPre ssedTextOpacity : replacementTextTextOpacity); 206 context->setAlpha(m_unavailablePluginIndicatorIsPressed ? replacementTextPre ssedTextOpacity : replacementTextTextOpacity);
207 context->setFillColor(Color::black, style()->colorSpace()); 207 context->setFillColor(Color::black, style()->colorSpace());
208 context->drawBidiText(font, run, FloatPoint(labelX, labelY)); 208 context->drawBidiText(font, run, FloatPoint(labelX, labelY), replacementText Rect);
209 } 209 }
210 210
211 bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumul atedOffset, FloatRect& contentRect, Path& path, FloatRect& replacementTextRect, Font& font, TextRun& run, float& textWidth) const 211 bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumul atedOffset, FloatRect& contentRect, Path& path, FloatRect& replacementTextRect, Font& font, TextRun& run, float& textWidth) const
212 { 212 {
213 contentRect = contentBoxRect(); 213 contentRect = contentBoxRect();
214 contentRect.moveBy(roundedIntPoint(accumulatedOffset)); 214 contentRect.moveBy(roundedIntPoint(accumulatedOffset));
215 215
216 FontDescription fontDescription; 216 FontDescription fontDescription;
217 RenderTheme::defaultTheme()->systemFont(CSSValueWebkitSmallControl, fontDesc ription); 217 RenderTheme::defaultTheme()->systemFont(CSSValueWebkitSmallControl, fontDesc ription);
218 fontDescription.setWeight(FontWeightBold); 218 fontDescription.setWeight(FontWeightBold);
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 428 }
429 return RenderPart::getCursor(point, cursor); 429 return RenderPart::getCursor(point, cursor);
430 } 430 }
431 431
432 bool RenderEmbeddedObject::canHaveChildren() const 432 bool RenderEmbeddedObject::canHaveChildren() const
433 { 433 {
434 return false; 434 return false;
435 } 435 }
436 436
437 } 437 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698