summaryrefslogtreecommitdiffstats
path: root/ui/snapshot
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-04-03 17:15:24 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-04 00:15:46 +0000
commit85d970e4cc6d5f71c30a94cd31d6f0fa07b38890 (patch)
tree364849f5b908f5f99f1a36ca54628b494758f2c7 /ui/snapshot
parent397accd46320292657b9ca5eea6c1a81a38ef004 (diff)
downloadchromium_src-85d970e4cc6d5f71c30a94cd31d6f0fa07b38890.zip
chromium_src-85d970e4cc6d5f71c30a94cd31d6f0fa07b38890.tar.gz
chromium_src-85d970e4cc6d5f71c30a94cd31d6f0fa07b38890.tar.bz2
Pass a ui::PaintContext from ui::Layer to layer delegates.
This is a plumbing CL to create a ui::PaintContext that wraps a gfx::Canvas up in ui::Layer. This is passed to every LayerDelegate, and also through to aura::WindowDelegates and views::NativeWidgetDelegates to eventually reach views::View as well. This way ui::PaintContext is created in one place (for compositor paints, there are other places painting to bitmaps we'll address later). And in the future the ui::PaintContext can be backed by a display list instead of a canvas. R=sky BUG=466426 Review URL: https://codereview.chromium.org/1057873004 Cr-Commit-Position: refs/heads/master@{#323855}
Diffstat (limited to 'ui/snapshot')
-rw-r--r--ui/snapshot/snapshot_aura_unittest.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/snapshot/snapshot_aura_unittest.cc b/ui/snapshot/snapshot_aura_unittest.cc
index b15a580..c134ca0 100644
--- a/ui/snapshot/snapshot_aura_unittest.cc
+++ b/ui/snapshot/snapshot_aura_unittest.cc
@@ -15,6 +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/test/context_factories_for_test.h"
#include "ui/compositor/test/draw_waiter_for_test.h"
#include "ui/gfx/canvas.h"
@@ -42,10 +43,12 @@ class TestPaintingWindowDelegate : public aura::test::TestWindowDelegate {
~TestPaintingWindowDelegate() override {}
- void OnPaint(gfx::Canvas* canvas) override {
+ void OnPaint(const ui::PaintContext& context) override {
for (int y = 0; y < window_size_.height(); ++y) {
- for (int x = 0; x < window_size_.width(); ++x)
- canvas->FillRect(gfx::Rect(x, y, 1, 1), GetExpectedColorForPoint(x, y));
+ for (int x = 0; x < window_size_.width(); ++x) {
+ context.canvas()->FillRect(gfx::Rect(x, y, 1, 1),
+ GetExpectedColorForPoint(x, y));
+ }
}
}