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

Unified Diff: Source/core/layout/LayoutTextControlSingleLine.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/layout/LayoutTextControlSingleLine.cpp
diff --git a/Source/core/layout/LayoutTextControlSingleLine.cpp b/Source/core/layout/LayoutTextControlSingleLine.cpp
index 078ae4970b16cb533e1df3a03655df4f607d8439..c6e2a51af97bba24f1c5ce1dde15ac5273381815 100644
--- a/Source/core/layout/LayoutTextControlSingleLine.cpp
+++ b/Source/core/layout/LayoutTextControlSingleLine.cpp
@@ -75,6 +75,9 @@ void LayoutTextControlSingleLine::paint(const PaintInfo& paintInfo, const Layout
LayoutTextControl::paint(paintInfo, paintOffset);
if (paintInfo.phase == PaintPhaseBlockBackground && m_shouldDrawCapsLockIndicator) {
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, *this, paintInfo.phase))
+ return;
+
LayoutRect contentsRect = contentBoxRect();
// Center in the block progression direction.
@@ -87,8 +90,7 @@ void LayoutTextControlSingleLine::paint(const PaintInfo& paintInfo, const Layout
contentsRect.moveBy(paintOffset + location());
IntRect snappedRect = pixelSnappedIntRect(contentsRect);
LayoutObjectDrawingRecorder recorder(*paintInfo.context, *this, paintInfo.phase, snappedRect);
- if (!recorder.canUseCachedDrawing())
- LayoutTheme::theme().painter().paintCapsLockIndicator(this, paintInfo, snappedRect);
+ LayoutTheme::theme().painter().paintCapsLockIndicator(this, paintInfo, snappedRect);
}
}

Powered by Google App Engine
This is Rietveld 408576698