Skip to content

Commit

Permalink
ash: Use PaintRecorder in CursorWindowDelegate
Browse files Browse the repository at this point in the history
Instead of accessing canvas() on the PaintContext directly, go
through the PaintRecorder. This will enable us to stop backing
the PaintContext with a Canvas for slimming-paint.

R=oshima
BUG=466426

Review URL: https://codereview.chromium.org/1056143002

Cr-Commit-Position: refs/heads/master@{#323959}
  • Loading branch information
danakj authored and Commit bot committed Apr 6, 2015
1 parent 866c3d4 commit 2c03b15
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ash/display/cursor_window_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {}
Expand Down

0 comments on commit 2c03b15

Please sign in to comment.