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

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

Issue 14160005: Track the region where text is painted. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: implemented TextRun wrapper Created 7 years, 7 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) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r)); 427 r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r));
428 428
429 if (element->hasTagName(optgroupTag)) { 429 if (element->hasTagName(optgroupTag)) {
430 FontDescription d = itemFont.fontDescription(); 430 FontDescription d = itemFont.fontDescription();
431 d.setWeight(d.bolderWeight()); 431 d.setWeight(d.bolderWeight());
432 itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing()); 432 itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
433 itemFont.update(document()->styleResolver()->fontSelector()); 433 itemFont.update(document()->styleResolver()->fontSelector());
434 } 434 }
435 435
436 // Draw the item text 436 // Draw the item text
437 paintInfo.context->drawBidiText(itemFont, textRun, roundedIntPoint(r.locatio n())); 437 TextRunPaintInfo textRunPaintInfo(textRun);
438 textRunPaintInfo.bounds = r;
439 paintInfo.context->drawBidiText(itemFont, textRunPaintInfo, roundedIntPoint( r.location()));
438 } 440 }
439 441
440 void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset, int listIndex) 442 void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset, int listIndex)
441 { 443 {
442 const Vector<HTMLElement*>& listItems = selectElement()->listItems(); 444 const Vector<HTMLElement*>& listItems = selectElement()->listItems();
443 HTMLElement* element = listItems[listIndex]; 445 HTMLElement* element = listItems[listIndex];
444 446
445 Color backColor; 447 Color backColor;
446 if (element->hasTagName(optionTag) && toHTMLOptionElement(element)->selected ()) { 448 if (element->hasTagName(optionTag) && toHTMLOptionElement(element)->selected ()) {
447 if (frame()->selection()->isFocusedAndActive() && document()->focusedNod e() == node()) 449 if (frame()->selection()->isFocusedAndActive() && document()->focusedNod e() == node())
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 881
880 if (m_vBar) 882 if (m_vBar)
881 m_vBar->styleChanged(); 883 m_vBar->styleChanged();
882 884
883 // Force an update since we know the scrollbars have changed things. 885 // Force an update since we know the scrollbars have changed things.
884 if (document()->hasAnnotatedRegions()) 886 if (document()->hasAnnotatedRegions())
885 document()->setAnnotatedRegionsDirty(true); 887 document()->setAnnotatedRegionsDirty(true);
886 } 888 }
887 889
888 } // namespace WebCore 890 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698