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

Unified Diff: ash/display/cursor_window_controller.cc

Issue 1021823002: Introduce ui::PaintRecorder and use it for CursorWindowDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: slimmingui-paintrecorder: rebase 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 | cc/resources/drawing_display_item.h » ('j') | 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 77f51cc7317aa133d7b8b3d3ba274802516246ad..514e44d9d023ff0cf08f83dd8635d0a7720dc0ca 100644
--- a/ash/display/cursor_window_controller.cc
+++ b/ash/display/cursor_window_controller.cc
@@ -16,6 +16,7 @@
#include "ui/base/hit_test.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/compositor/dip_util.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,9 +50,10 @@ class CursorWindowDelegate : public aura::WindowDelegate {
void OnCaptureLost() override {}
void OnPaintToDisplayList(cc::DisplayItemList* list,
float device_scale_factor) override {
- // TODO(danakj): Implement it. Does this need to be the same as
- // View::OnPaintLayerToDisplayList? Can they share code?
- NOTIMPLEMENTED();
+ gfx::Rect record_bounds(size_);
+ ui::PaintRecorder recorder(record_bounds, device_scale_factor);
+ OnPaint(recorder.canvas());
+ recorder.AppendDisplayItem(list);
}
void OnPaint(gfx::Canvas* canvas) override {
canvas->DrawImageInt(cursor_image_, 0, 0);
« no previous file with comments | « no previous file | cc/resources/drawing_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698