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

Side by Side Diff: ui/compositor/layer.h

Issue 10201014: Implement High Contrast mode for Chrome OS (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Code review fix Created 8 years, 7 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
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_COMPOSITOR_LAYER_H_ 5 #ifndef UI_COMPOSITOR_LAYER_H_
6 #define UI_COMPOSITOR_LAYER_H_ 6 #define UI_COMPOSITOR_LAYER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // The opacity of the layer. The opacity is applied to each pixel of the 127 // The opacity of the layer. The opacity is applied to each pixel of the
128 // texture (resulting alpha = opacity * alpha). 128 // texture (resulting alpha = opacity * alpha).
129 float opacity() const { return opacity_; } 129 float opacity() const { return opacity_; }
130 void SetOpacity(float opacity); 130 void SetOpacity(float opacity);
131 131
132 // Blur pixels by this amount in anything below the layer and visible through 132 // Blur pixels by this amount in anything below the layer and visible through
133 // the layer. 133 // the layer.
134 int background_blur() const { return background_blur_radius_; } 134 int background_blur() const { return background_blur_radius_; }
135 void SetBackgroundBlur(int blur_radius); 135 void SetBackgroundBlur(int blur_radius);
136 136
137 // Invert the layer.
138 bool invert() const { return invert_; }
139 void SetInvert(bool invert);
sky 2012/05/16 21:07:48 SetInverted
Zachary Kuznia 2012/05/17 08:25:25 Done.
140
137 // Return the target opacity if animator is running, or the current opacity 141 // Return the target opacity if animator is running, or the current opacity
138 // otherwise. 142 // otherwise.
139 float GetTargetOpacity() const; 143 float GetTargetOpacity() const;
140 144
141 // Sets the visibility of the Layer. A Layer may be visible but not 145 // Sets the visibility of the Layer. A Layer may be visible but not
142 // drawn. This happens if any ancestor of a Layer is not visible. 146 // drawn. This happens if any ancestor of a Layer is not visible.
143 void SetVisible(bool visible); 147 void SetVisible(bool visible);
144 bool visible() const { return visible_; } 148 bool visible() const { return visible_; }
145 149
146 // Returns the target visibility if the animator is running. Otherwise, it 150 // Returns the target visibility if the animator is running. Otherwise, it
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 285
282 // If true the layer is always up to date. 286 // If true the layer is always up to date.
283 bool layer_updated_externally_; 287 bool layer_updated_externally_;
284 288
285 // Union of damaged rects, in pixel coordinates, to be used when 289 // Union of damaged rects, in pixel coordinates, to be used when
286 // compositor is ready to paint the content. 290 // compositor is ready to paint the content.
287 SkRegion damaged_region_; 291 SkRegion damaged_region_;
288 292
289 float opacity_; 293 float opacity_;
290 int background_blur_radius_; 294 int background_blur_radius_;
295 bool invert_;
sky 2012/05/16 21:07:48 inverted
Zachary Kuznia 2012/05/17 08:25:25 Done.
291 296
292 std::string name_; 297 std::string name_;
293 298
294 LayerDelegate* delegate_; 299 LayerDelegate* delegate_;
295 300
296 scoped_ptr<LayerAnimator> animator_; 301 scoped_ptr<LayerAnimator> animator_;
297 302
298 WebKit::WebLayer web_layer_; 303 WebKit::WebLayer web_layer_;
299 bool web_layer_is_accelerated_; 304 bool web_layer_is_accelerated_;
300 bool show_debug_borders_; 305 bool show_debug_borders_;
301 306
302 // If true, the layer scales the canvas using device scale factor 307 // If true, the layer scales the canvas using device scale factor
303 // before passing to LayerDelegate::OnLayerPaint. 308 // before passing to LayerDelegate::OnLayerPaint.
304 bool scale_canvas_; 309 bool scale_canvas_;
305 310
306 // A cached copy of |Compositor::device_scale_factor()|. 311 // A cached copy of |Compositor::device_scale_factor()|.
307 float device_scale_factor_; 312 float device_scale_factor_;
308 313
309 DISALLOW_COPY_AND_ASSIGN(Layer); 314 DISALLOW_COPY_AND_ASSIGN(Layer);
310 }; 315 };
311 316
312 } // namespace ui 317 } // namespace ui
313 318
314 #endif // UI_COMPOSITOR_LAYER_H_ 319 #endif // UI_COMPOSITOR_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698