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

Unified Diff: ui/aura/window_unittest.cc

Issue 1053143002: Make View::Paint use ui::PaintRecorder to access PaintContext's canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: paintrecorder: . 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
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index 60b113556035ef5ee3cd6ba4b7c4e1cff499ba61..8f61820754f178cd154266c1f87441fefe89a8c2 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -31,6 +31,7 @@
#include "ui/base/hit_test.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_observer.h"
+#include "ui/compositor/paint_context.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/compositor/test/test_layers.h"
@@ -3044,7 +3045,8 @@ class PaintWindowDelegate : public TestWindowDelegate {
int paint_count() const { return paint_count_; }
// TestWindowDelegate::
- void OnPaint(gfx::Canvas* canvas) override {
+ void OnPaint(const ui::PaintContext& context) override {
+ gfx::Canvas* canvas = context.canvas();
paint_count_++;
canvas->GetClipBounds(&most_recent_paint_clip_bounds_);
const SkMatrix& matrix = canvas->sk_canvas()->getTotalMatrix();
@@ -3106,7 +3108,7 @@ TEST_F(WindowTest, PaintLayerless) {
// Paint the root, this should trigger painting of the two layerless
// descendants but not the layered descendant.
gfx::Canvas canvas(gfx::Size(200, 200), 1.0f, true);
- static_cast<ui::LayerDelegate&>(root).OnPaintLayer(&canvas);
+ static_cast<ui::LayerDelegate&>(root).OnPaintLayer(ui::PaintContext(&canvas));
// NOTE: SkCanvas::getClipBounds() extends the clip 1 pixel to the left and up
// and 2 pixels down and to the right.

Powered by Google App Engine
This is Rietveld 408576698