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

Unified Diff: Source/core/layout/LayoutTextControlSingleLine.cpp

Issue 1177043016: [SP] Add a drawing recorder before painting caps lock indicator in password fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Need to rebaseline new tests under virtual/antialiasedtext as well. 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
« no previous file with comments | « LayoutTests/fast/text/caps-lock-indicator-enabled.html ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutTextControlSingleLine.cpp
diff --git a/Source/core/layout/LayoutTextControlSingleLine.cpp b/Source/core/layout/LayoutTextControlSingleLine.cpp
index 8c6b0d66d0781aa5d5ad9bc5a017060128b0b21c..078ae4970b16cb533e1df3a03655df4f607d8439 100644
--- a/Source/core/layout/LayoutTextControlSingleLine.cpp
+++ b/Source/core/layout/LayoutTextControlSingleLine.cpp
@@ -34,6 +34,7 @@
#include "core/layout/LayoutAnalyzer.h"
#include "core/layout/LayoutTheme.h"
#include "core/paint/DeprecatedPaintLayer.h"
+#include "core/paint/LayoutObjectDrawingRecorder.h"
#include "core/paint/PaintInfo.h"
#include "core/paint/ThemePainter.h"
#include "platform/PlatformKeyboardEvent.h"
@@ -84,7 +85,10 @@ void LayoutTextControlSingleLine::paint(const PaintInfo& paintInfo, const Layout
// Convert the rect into the coords used for painting the content
contentsRect.moveBy(paintOffset + location());
- LayoutTheme::theme().painter().paintCapsLockIndicator(this, paintInfo, pixelSnappedIntRect(contentsRect));
+ IntRect snappedRect = pixelSnappedIntRect(contentsRect);
+ LayoutObjectDrawingRecorder recorder(*paintInfo.context, *this, paintInfo.phase, snappedRect);
+ if (!recorder.canUseCachedDrawing())
+ LayoutTheme::theme().painter().paintCapsLockIndicator(this, paintInfo, snappedRect);
}
}
« no previous file with comments | « LayoutTests/fast/text/caps-lock-indicator-enabled.html ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698