OLD | NEW |
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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // Change the grayscale of all pixels from this layer by this amount. | 161 // Change the grayscale of all pixels from this layer by this amount. |
162 // This effect will get "combined" with the inverted, saturate | 162 // This effect will get "combined" with the inverted, saturate |
163 // and brightness setting. | 163 // and brightness setting. |
164 float layer_grayscale() const { return layer_grayscale_; } | 164 float layer_grayscale() const { return layer_grayscale_; } |
165 void SetLayerGrayscale(float grayscale); | 165 void SetLayerGrayscale(float grayscale); |
166 | 166 |
167 // Return the target grayscale if animator is running, or the current | 167 // Return the target grayscale if animator is running, or the current |
168 // grayscale otherwise. | 168 // grayscale otherwise. |
169 float GetTargetGrayscale() const; | 169 float GetTargetGrayscale() const; |
170 | 170 |
| 171 // Zoom the background by this amount. |
| 172 void SetBackgroundZoom(float x_offset, float y_offset, float zoom); |
| 173 |
171 // Invert the layer. | 174 // Invert the layer. |
172 bool layer_inverted() const { return layer_inverted_; } | 175 bool layer_inverted() const { return layer_inverted_; } |
173 void SetLayerInverted(bool inverted); | 176 void SetLayerInverted(bool inverted); |
174 | 177 |
175 // Return the target opacity if animator is running, or the current opacity | 178 // Return the target opacity if animator is running, or the current opacity |
176 // otherwise. | 179 // otherwise. |
177 float GetTargetOpacity() const; | 180 float GetTargetOpacity() const; |
178 | 181 |
179 // Set a layer mask for a layer. | 182 // Set a layer mask for a layer. |
180 // Note the provided layer mask can neither have a layer mask itself nor can | 183 // Note the provided layer mask can neither have a layer mask itself nor can |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 float layer_grayscale_; | 367 float layer_grayscale_; |
365 bool layer_inverted_; | 368 bool layer_inverted_; |
366 | 369 |
367 // The associated mask layer with this layer. | 370 // The associated mask layer with this layer. |
368 Layer* layer_mask_; | 371 Layer* layer_mask_; |
369 // The back link from the mask layer to it's associated masked layer. | 372 // The back link from the mask layer to it's associated masked layer. |
370 // We keep this reference for the case that if the mask layer gets deleted | 373 // We keep this reference for the case that if the mask layer gets deleted |
371 // while attached to the main layer before the main layer is deleted. | 374 // while attached to the main layer before the main layer is deleted. |
372 Layer* layer_mask_back_link_; | 375 Layer* layer_mask_back_link_; |
373 | 376 |
| 377 float zoom_x_offset_; |
| 378 float zoom_y_offset_; |
| 379 float zoom_; |
| 380 |
374 std::string name_; | 381 std::string name_; |
375 | 382 |
376 LayerDelegate* delegate_; | 383 LayerDelegate* delegate_; |
377 | 384 |
378 scoped_ptr<LayerAnimator> animator_; | 385 scoped_ptr<LayerAnimator> animator_; |
379 | 386 |
380 // Ownership of the layer is held through one of the strongly typed layer | 387 // Ownership of the layer is held through one of the strongly typed layer |
381 // pointers, depending on which sort of layer this is. | 388 // pointers, depending on which sort of layer this is. |
382 scoped_ptr<WebKit::WebContentLayer> content_layer_; | 389 scoped_ptr<WebKit::WebContentLayer> content_layer_; |
383 scoped_ptr<WebKit::WebExternalTextureLayer> texture_layer_; | 390 scoped_ptr<WebKit::WebExternalTextureLayer> texture_layer_; |
384 scoped_ptr<WebKit::WebSolidColorLayer> solid_color_layer_; | 391 scoped_ptr<WebKit::WebSolidColorLayer> solid_color_layer_; |
385 WebKit::WebLayer* web_layer_; | 392 WebKit::WebLayer* web_layer_; |
386 bool web_layer_is_accelerated_; | 393 bool web_layer_is_accelerated_; |
387 bool show_debug_borders_; | 394 bool show_debug_borders_; |
388 | 395 |
389 // If true, the layer scales the canvas and the texture with the device scale | 396 // If true, the layer scales the canvas and the texture with the device scale |
390 // factor as appropriate. When true, the texture size is in DIP. | 397 // factor as appropriate. When true, the texture size is in DIP. |
391 bool scale_content_; | 398 bool scale_content_; |
392 | 399 |
393 // A cached copy of |Compositor::device_scale_factor()|. | 400 // A cached copy of |Compositor::device_scale_factor()|. |
394 float device_scale_factor_; | 401 float device_scale_factor_; |
395 | 402 |
396 DISALLOW_COPY_AND_ASSIGN(Layer); | 403 DISALLOW_COPY_AND_ASSIGN(Layer); |
397 }; | 404 }; |
398 | 405 |
399 } // namespace ui | 406 } // namespace ui |
400 | 407 |
401 #endif // UI_COMPOSITOR_LAYER_H_ | 408 #endif // UI_COMPOSITOR_LAYER_H_ |
OLD | NEW |