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

Unified Diff: ash/display/cursor_window_controller.cc

Issue 1056143002: ash: Use PaintRecorder in CursorWindowDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/cursor_window_controller.cc
diff --git a/ash/display/cursor_window_controller.cc b/ash/display/cursor_window_controller.cc
index d9badb1d0aacbf11a1a2570cc7c3b1c69990497c..5b94a0ca806bc8c851cc2aee74b2a4febe3e8c88 100644
--- a/ash/display/cursor_window_controller.cc
+++ b/ash/display/cursor_window_controller.cc
@@ -17,6 +17,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/compositor/dip_util.h"
#include "ui/compositor/paint_context.h"
+#include "ui/compositor/paint_recorder.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/display.h"
#include "ui/gfx/image/image_skia.h"
@@ -49,7 +50,9 @@ class CursorWindowDelegate : public aura::WindowDelegate {
bool CanFocus() override { return false; }
void OnCaptureLost() override {}
void OnPaint(const ui::PaintContext& context) override {
- context.canvas()->DrawImageInt(cursor_image_, 0, 0);
+ // No need to cache the output here, the CursorWindow is not invalidated.
+ ui::PaintRecorder recorder(context);
+ recorder.canvas()->DrawImageInt(cursor_image_, 0, 0);
}
void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
void OnWindowDestroying(aura::Window* window) override {}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698