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

Unified Diff: ui/snapshot/snapshot_aura_unittest.cc

Issue 1064133003: ui: Use a PaintRecorder to access the Canvas for painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/snapshot/snapshot_aura_unittest.cc
diff --git a/ui/snapshot/snapshot_aura_unittest.cc b/ui/snapshot/snapshot_aura_unittest.cc
index c134ca08aba37d43b78ffc485927b8fbe2628532..e3798526ef782aec65a966973715a5b01b328098 100644
--- a/ui/snapshot/snapshot_aura_unittest.cc
+++ b/ui/snapshot/snapshot_aura_unittest.cc
@@ -15,7 +15,7 @@
#include "ui/aura/window_event_dispatcher.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/layer.h"
-#include "ui/compositor/paint_context.h"
+#include "ui/compositor/paint_recorder.h"
#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/compositor/test/draw_waiter_for_test.h"
#include "ui/gfx/canvas.h"
@@ -44,10 +44,11 @@ class TestPaintingWindowDelegate : public aura::test::TestWindowDelegate {
~TestPaintingWindowDelegate() override {}
void OnPaint(const ui::PaintContext& context) override {
+ ui::PaintRecorder recorder(context);
for (int y = 0; y < window_size_.height(); ++y) {
for (int x = 0; x < window_size_.width(); ++x) {
- context.canvas()->FillRect(gfx::Rect(x, y, 1, 1),
- GetExpectedColorForPoint(x, y));
+ recorder.canvas()->FillRect(gfx::Rect(x, y, 1, 1),
+ GetExpectedColorForPoint(x, y));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698