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

Side by Side Diff: ui/aura/window_unittest.cc

Issue 1057873004: Pass a ui::PaintContext from ui::Layer to layer delegates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layer-paintcontext: mac 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 unified diff | Download patch
« no previous file with comments | « ui/aura/window_delegate.h ('k') | ui/aura_extra/image_window_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 13 matching lines...) Expand all
24 #include "ui/aura/test/test_windows.h" 24 #include "ui/aura/test/test_windows.h"
25 #include "ui/aura/test/window_test_api.h" 25 #include "ui/aura/test/window_test_api.h"
26 #include "ui/aura/window_delegate.h" 26 #include "ui/aura/window_delegate.h"
27 #include "ui/aura/window_event_dispatcher.h" 27 #include "ui/aura/window_event_dispatcher.h"
28 #include "ui/aura/window_observer.h" 28 #include "ui/aura/window_observer.h"
29 #include "ui/aura/window_property.h" 29 #include "ui/aura/window_property.h"
30 #include "ui/aura/window_tree_host.h" 30 #include "ui/aura/window_tree_host.h"
31 #include "ui/base/hit_test.h" 31 #include "ui/base/hit_test.h"
32 #include "ui/compositor/layer.h" 32 #include "ui/compositor/layer.h"
33 #include "ui/compositor/layer_animation_observer.h" 33 #include "ui/compositor/layer_animation_observer.h"
34 #include "ui/compositor/paint_context.h"
34 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 35 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
35 #include "ui/compositor/scoped_layer_animation_settings.h" 36 #include "ui/compositor/scoped_layer_animation_settings.h"
36 #include "ui/compositor/test/test_layers.h" 37 #include "ui/compositor/test/test_layers.h"
37 #include "ui/events/event.h" 38 #include "ui/events/event.h"
38 #include "ui/events/event_utils.h" 39 #include "ui/events/event_utils.h"
39 #include "ui/events/gesture_detection/gesture_configuration.h" 40 #include "ui/events/gesture_detection/gesture_configuration.h"
40 #include "ui/events/keycodes/keyboard_codes.h" 41 #include "ui/events/keycodes/keyboard_codes.h"
41 #include "ui/events/test/event_generator.h" 42 #include "ui/events/test/event_generator.h"
42 #include "ui/gfx/canvas.h" 43 #include "ui/gfx/canvas.h"
43 #include "ui/gfx/geometry/vector2d.h" 44 #include "ui/gfx/geometry/vector2d.h"
(...skipping 2808 matching lines...) Expand 10 before | Expand all | Expand 10 after
2852 } 2853 }
2853 2854
2854 const gfx::Vector2d& most_recent_paint_matrix_offset() const { 2855 const gfx::Vector2d& most_recent_paint_matrix_offset() const {
2855 return most_recent_paint_matrix_offset_; 2856 return most_recent_paint_matrix_offset_;
2856 } 2857 }
2857 2858
2858 void clear_paint_count() { paint_count_ = 0; } 2859 void clear_paint_count() { paint_count_ = 0; }
2859 int paint_count() const { return paint_count_; } 2860 int paint_count() const { return paint_count_; }
2860 2861
2861 // TestWindowDelegate:: 2862 // TestWindowDelegate::
2862 void OnPaint(gfx::Canvas* canvas) override { 2863 void OnPaint(const ui::PaintContext& context) override {
2864 gfx::Canvas* canvas = context.canvas();
2863 paint_count_++; 2865 paint_count_++;
2864 canvas->GetClipBounds(&most_recent_paint_clip_bounds_); 2866 canvas->GetClipBounds(&most_recent_paint_clip_bounds_);
2865 const SkMatrix& matrix = canvas->sk_canvas()->getTotalMatrix(); 2867 const SkMatrix& matrix = canvas->sk_canvas()->getTotalMatrix();
2866 most_recent_paint_matrix_offset_ = gfx::Vector2d( 2868 most_recent_paint_matrix_offset_ = gfx::Vector2d(
2867 SkScalarFloorToInt(matrix.getTranslateX()), 2869 SkScalarFloorToInt(matrix.getTranslateX()),
2868 SkScalarFloorToInt(matrix.getTranslateY())); 2870 SkScalarFloorToInt(matrix.getTranslateY()));
2869 } 2871 }
2870 2872
2871 private: 2873 private:
2872 int paint_count_; 2874 int paint_count_;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
2960 2962
2961 EXPECT_TRUE(animator.get()); 2963 EXPECT_TRUE(animator.get());
2962 EXPECT_FALSE(animator->is_animating()); 2964 EXPECT_FALSE(animator->is_animating());
2963 EXPECT_TRUE(observer.animation_completed()); 2965 EXPECT_TRUE(observer.animation_completed());
2964 EXPECT_FALSE(observer.animation_aborted()); 2966 EXPECT_FALSE(observer.animation_aborted());
2965 animator->RemoveObserver(&observer); 2967 animator->RemoveObserver(&observer);
2966 } 2968 }
2967 2969
2968 } // namespace test 2970 } // namespace test
2969 } // namespace aura 2971 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_delegate.h ('k') | ui/aura_extra/image_window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698