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

Side by Side Diff: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp

Issue 2124553002: Refine cull rect for SVGInlineTextBox painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add boundsForDrawingRecorder; expose helper from InlineTextBoxPainter Created 4 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/InlineTextBoxPainter.h" 5 #include "core/paint/InlineTextBoxPainter.h"
6 6
7 #include "core/editing/CompositionUnderline.h" 7 #include "core/editing/CompositionUnderline.h"
8 #include "core/editing/Editor.h" 8 #include "core/editing/Editor.h"
9 #include "core/editing/markers/DocumentMarkerController.h" 9 #include "core/editing/markers/DocumentMarkerController.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 21 matching lines...) Expand all
32 gTextBlobCache->remove(&inlineTextBox); 32 gTextBlobCache->remove(&inlineTextBox);
33 } 33 }
34 34
35 static TextBlobPtr* addToTextBlobCache(const InlineTextBox& inlineTextBox) 35 static TextBlobPtr* addToTextBlobCache(const InlineTextBox& inlineTextBox)
36 { 36 {
37 if (!gTextBlobCache) 37 if (!gTextBlobCache)
38 gTextBlobCache = new InlineTextBoxBlobCacheMap; 38 gTextBlobCache = new InlineTextBoxBlobCacheMap;
39 return &gTextBlobCache->add(&inlineTextBox, nullptr).storedValue->value; 39 return &gTextBlobCache->add(&inlineTextBox, nullptr).storedValue->value;
40 } 40 }
41 41
42 static bool paintsMarkerHighlights(const LayoutObject& layoutObject) 42 bool InlineTextBoxPainter::paintsMarkerHighlights(const LayoutObject& layoutObje ct)
43 { 43 {
44 return layoutObject.node() && layoutObject.document().markers().hasMarkers(l ayoutObject.node()); 44 return layoutObject.node() && layoutObject.document().markers().hasMarkers(l ayoutObject.node());
45 } 45 }
46 46
47 static bool paintsCompositionMarkers(const LayoutObject& layoutObject) 47 static bool paintsCompositionMarkers(const LayoutObject& layoutObject)
48 { 48 {
49 return layoutObject.node() && layoutObject.document().markers().markersFor(l ayoutObject.node(), DocumentMarker::Composition).size() > 0; 49 return layoutObject.node() && layoutObject.document().markers().markersFor(l ayoutObject.node(), DocumentMarker::Composition).size() > 0;
50 } 50 }
51 51
52 void InlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) 52 void InlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 GraphicsContext& context = paintInfo.context; 840 GraphicsContext& context = paintInfo.context;
841 GraphicsContextStateSaver stateSaver(context); 841 GraphicsContextStateSaver stateSaver(context);
842 842
843 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), m_i nlineTextBox.logicalHeight())); 843 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), m_i nlineTextBox.logicalHeight()));
844 context.clip(FloatRect(boxRect)); 844 context.clip(FloatRect(boxRect));
845 context.drawHighlightForText(font, run, FloatPoint(boxOrigin), boxRect.heigh t(), color, sPos, ePos); 845 context.drawHighlightForText(font, run, FloatPoint(boxOrigin), boxRect.heigh t(), color, sPos, ePos);
846 } 846 }
847 847
848 848
849 } // namespace blink 849 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698