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

Unified Diff: ui/aura/window_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
« no previous file with comments | « ui/aura/test/test_window_delegate.cc ('k') | ui/aura_extra/aura_extra.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index c7a06292726ff214e801c7beafb1977029b80a88..b2f1759e63193eed103758c35f27945805f673d1 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -31,7 +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/paint_recorder.h"
sadrul 2015/04/07 21:10:13 Perhaps this include isn't necessary at all?
danakj 2015/04/07 21:11:48 Oh, seems not!
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/compositor/test/test_layers.h"
@@ -2841,47 +2841,6 @@ TEST_F(WindowTest, OnWindowHierarchyChange) {
namespace {
-// Tracks the number of times paint is invoked along with what the clip and
-// translate was.
-class PaintWindowDelegate : public TestWindowDelegate {
- public:
- PaintWindowDelegate() : paint_count_(0) {}
- ~PaintWindowDelegate() override {}
-
- const gfx::Rect& most_recent_paint_clip_bounds() const {
- return most_recent_paint_clip_bounds_;
- }
-
- const gfx::Vector2d& most_recent_paint_matrix_offset() const {
- return most_recent_paint_matrix_offset_;
- }
-
- void clear_paint_count() { paint_count_ = 0; }
- int paint_count() const { return paint_count_; }
-
- // TestWindowDelegate::
- 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();
- most_recent_paint_matrix_offset_ = gfx::Vector2d(
- SkScalarFloorToInt(matrix.getTranslateX()),
- SkScalarFloorToInt(matrix.getTranslateY()));
- }
-
- private:
- int paint_count_;
- gfx::Rect most_recent_paint_clip_bounds_;
- gfx::Vector2d most_recent_paint_matrix_offset_;
-
- DISALLOW_COPY_AND_ASSIGN(PaintWindowDelegate);
-};
-
-} // namespace
-
-namespace {
-
class TestLayerAnimationObserver : public ui::LayerAnimationObserver {
public:
TestLayerAnimationObserver()
« no previous file with comments | « ui/aura/test/test_window_delegate.cc ('k') | ui/aura_extra/aura_extra.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698