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

Unified Diff: Source/core/paint/FileUploadControlPainter.cpp

Issue 1220583004: Refactor DrawingRecorders to check for cached drawings earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix some !'s and &&'s. De Morgan would be proud. Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/paint/FileUploadControlPainter.cpp
diff --git a/Source/core/paint/FileUploadControlPainter.cpp b/Source/core/paint/FileUploadControlPainter.cpp
index 66e7d1d60acb21fe4f35c283a477e5924c94811e..07f0efb63ecadc8acd0c9ebf214e476351416e67 100644
--- a/Source/core/paint/FileUploadControlPainter.cpp
+++ b/Source/core/paint/FileUploadControlPainter.cpp
@@ -33,7 +33,7 @@ void FileUploadControlPainter::paintObject(const PaintInfo& paintInfo, const Lay
clipRecorder.emplace(*paintInfo.context, m_layoutFileUploadControl, DisplayItem::ClipFileUploadControlRect, LayoutRect(clipRect));
}
- if (paintInfo.phase == PaintPhaseForeground) {
+ if (paintInfo.phase == PaintPhaseForeground && !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutFileUploadControl, paintInfo.phase)) {
const String& displayedFilename = m_layoutFileUploadControl.fileTextValue();
const Font& font = m_layoutFileUploadControl.style()->font();
TextRun textRun = constructTextRun(&m_layoutFileUploadControl, font, displayedFilename, m_layoutFileUploadControl.styleRef(), RespectDirection | RespectDirectionOverride);
@@ -68,10 +68,8 @@ void FileUploadControlPainter::paintObject(const PaintInfo& paintInfo, const Lay
// Draw the filename.
LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutFileUploadControl, paintInfo.phase, textRunPaintInfo.bounds);
- if (!recorder.canUseCachedDrawing()) {
- paintInfo.context->setFillColor(m_layoutFileUploadControl.resolveColor(CSSPropertyColor));
- paintInfo.context->drawBidiText(font, textRunPaintInfo, FloatPoint(roundToInt(textX), roundToInt(textY)));
- }
+ paintInfo.context->setFillColor(m_layoutFileUploadControl.resolveColor(CSSPropertyColor));
+ paintInfo.context->drawBidiText(font, textRunPaintInfo, FloatPoint(roundToInt(textX), roundToInt(textY)));
}
// Paint the children.

Powered by Google App Engine
This is Rietveld 408576698