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

Side by Side Diff: ui/wm/core/image_grid.h

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/views/widget/widget_unittest.cc ('k') | ui/wm/core/image_grid.cc » ('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 #ifndef UI_WM_CORE_IMAGE_GRID_H_ 5 #ifndef UI_WM_CORE_IMAGE_GRID_H_
6 #define UI_WM_CORE_IMAGE_GRID_H_ 6 #define UI_WM_CORE_IMAGE_GRID_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 class ImagePainter : public ui::LayerDelegate { 130 class ImagePainter : public ui::LayerDelegate {
131 public: 131 public:
132 ImagePainter(const gfx::ImageSkia& image) : image_(image) {} 132 ImagePainter(const gfx::ImageSkia& image) : image_(image) {}
133 ~ImagePainter() override {} 133 ~ImagePainter() override {}
134 134
135 // Clips |layer| to |clip_rect|. Triggers a repaint if the clipping 135 // Clips |layer| to |clip_rect|. Triggers a repaint if the clipping
136 // rectangle has changed. An empty rectangle disables clipping. 136 // rectangle has changed. An empty rectangle disables clipping.
137 void SetClipRect(const gfx::Rect& clip_rect, ui::Layer* layer); 137 void SetClipRect(const gfx::Rect& clip_rect, ui::Layer* layer);
138 138
139 // ui::LayerDelegate implementation: 139 // ui::LayerDelegate implementation:
140 void OnPaintLayer(gfx::Canvas* canvas) override; 140 void OnPaintLayer(const ui::PaintContext& context) override;
141 void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override; 141 void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override;
142 void OnDeviceScaleFactorChanged(float device_scale_factor) override; 142 void OnDeviceScaleFactorChanged(float device_scale_factor) override;
143 base::Closure PrepareForLayerBoundsChange() override; 143 base::Closure PrepareForLayerBoundsChange() override;
144 144
145 private: 145 private:
146 friend class TestAPI; 146 friend class TestAPI;
147 147
148 const gfx::ImageSkia image_; 148 const gfx::ImageSkia image_;
149 149
150 gfx::Rect clip_rect_; 150 gfx::Rect clip_rect_;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 scoped_ptr<ImagePainter> bottom_left_painter_; 213 scoped_ptr<ImagePainter> bottom_left_painter_;
214 scoped_ptr<ImagePainter> bottom_painter_; 214 scoped_ptr<ImagePainter> bottom_painter_;
215 scoped_ptr<ImagePainter> bottom_right_painter_; 215 scoped_ptr<ImagePainter> bottom_right_painter_;
216 216
217 DISALLOW_COPY_AND_ASSIGN(ImageGrid); 217 DISALLOW_COPY_AND_ASSIGN(ImageGrid);
218 }; 218 };
219 219
220 } // namespace wm 220 } // namespace wm
221 221
222 #endif // UI_WM_CORE_IMAGE_GRID_H_ 222 #endif // UI_WM_CORE_IMAGE_GRID_H_
OLDNEW
« no previous file with comments | « ui/views/widget/widget_unittest.cc ('k') | ui/wm/core/image_grid.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698