summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-04-08 03:53:37 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-08 10:54:03 +0000
commita002bde549dd2edf1a5c1487c3711730937edf52 (patch)
tree20409f93fe9f6436d7e2550373fafc23a163a6e2 /ui
parent8ff5c840f60d0fef4788a4d4d9747f7e0ace641c (diff)
downloadchromium_src-a002bde549dd2edf1a5c1487c3711730937edf52.zip
chromium_src-a002bde549dd2edf1a5c1487c3711730937edf52.tar.gz
chromium_src-a002bde549dd2edf1a5c1487c3711730937edf52.tar.bz2
ui: Remove the canvas() member from PaintContext.
The canvas() is now only accessed through the Recorder classes (ie. PaintRecorder and friends). Now we can put a DisplayItemList instead of a Canvas inside PaintContext. R=piman@chromium.org BUG=466426 Review URL: https://codereview.chromium.org/1069183002 Cr-Commit-Position: refs/heads/master@{#324210}
Diffstat (limited to 'ui')
-rw-r--r--ui/compositor/clip_transform_recorder.cc2
-rw-r--r--ui/compositor/compositing_recorder.cc2
-rw-r--r--ui/compositor/paint_context.h11
-rw-r--r--ui/compositor/paint_recorder.cc2
4 files changed, 9 insertions, 8 deletions
diff --git a/ui/compositor/clip_transform_recorder.cc b/ui/compositor/clip_transform_recorder.cc
index 653c818..318db1f 100644
--- a/ui/compositor/clip_transform_recorder.cc
+++ b/ui/compositor/clip_transform_recorder.cc
@@ -13,7 +13,7 @@
namespace ui {
ClipTransformRecorder::ClipTransformRecorder(const PaintContext& context)
- : canvas_(context.canvas()) {
+ : canvas_(context.canvas_) {
canvas_->Save();
}
diff --git a/ui/compositor/compositing_recorder.cc b/ui/compositor/compositing_recorder.cc
index 20426af..e4b80ce 100644
--- a/ui/compositor/compositing_recorder.cc
+++ b/ui/compositor/compositing_recorder.cc
@@ -11,7 +11,7 @@ namespace ui {
CompositingRecorder::CompositingRecorder(const PaintContext& context,
uint8_t alpha)
- : canvas_(context.canvas()), saved_(alpha < 255) {
+ : canvas_(context.canvas_), saved_(alpha < 255) {
if (saved_)
canvas_->SaveLayerAlpha(alpha);
}
diff --git a/ui/compositor/paint_context.h b/ui/compositor/paint_context.h
index 914f9a9..1d899c5 100644
--- a/ui/compositor/paint_context.h
+++ b/ui/compositor/paint_context.h
@@ -13,6 +13,8 @@ class Canvas;
}
namespace ui {
+class ClipTransformRecorder;
+class CompositingRecorder;
class PaintRecorder;
class PaintContext {
@@ -43,9 +45,6 @@ class PaintContext {
return PaintContext(canvas_);
}
- // TODO(danakj): Remove this once everything is painting to display lists.
- gfx::Canvas* canvas() const { return canvas_; }
-
// When true, IsRectInvalidated() can be called, otherwise its result would be
// invalid.
bool CanCheckInvalidated() const { return !invalidation_.IsEmpty(); }
@@ -70,9 +69,11 @@ class PaintContext {
const gfx::Rect& InvalidationForTesting() const { return invalidation_; }
private:
- // The PaintRecorder needs access to the internal canvas and friends, but we
+ // The Recorder classes need access to the internal canvas and friends, but we
// don't want to expose them on this class so that people must go through the
- // recorder to access them.
+ // recorders to access them.
+ friend class ClipTransformRecorder;
+ friend class CompositingRecorder;
friend class PaintRecorder;
// Clone a PaintContext with an additional |offset|.
diff --git a/ui/compositor/paint_recorder.cc b/ui/compositor/paint_recorder.cc
index 538db4b..492028f 100644
--- a/ui/compositor/paint_recorder.cc
+++ b/ui/compositor/paint_recorder.cc
@@ -9,7 +9,7 @@
namespace ui {
PaintRecorder::PaintRecorder(const PaintContext& context)
- : canvas_(context.canvas()) {
+ : canvas_(context.canvas_) {
}
PaintRecorder::~PaintRecorder() {