| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Change the grayscale of all pixels from this layer by this amount. | 173 // Change the grayscale of all pixels from this layer by this amount. |
| 174 // This effect will get "combined" with the inverted, saturate | 174 // This effect will get "combined" with the inverted, saturate |
| 175 // and brightness setting. | 175 // and brightness setting. |
| 176 float layer_grayscale() const { return layer_grayscale_; } | 176 float layer_grayscale() const { return layer_grayscale_; } |
| 177 void SetLayerGrayscale(float grayscale); | 177 void SetLayerGrayscale(float grayscale); |
| 178 | 178 |
| 179 // Return the target grayscale if animator is running, or the current | 179 // Return the target grayscale if animator is running, or the current |
| 180 // grayscale otherwise. | 180 // grayscale otherwise. |
| 181 float GetTargetGrayscale() const; | 181 float GetTargetGrayscale() const; |
| 182 | 182 |
| 183 // Zoom the background by a factor of |zoom|. The upper left corner of the | 183 // Zoom the background by a factor of |zoom|. The effect is blended along the |
| 184 // zoomed area is offset from the top left corner of the layer by |x_offset| | 184 // edge across |inset| pixels. |
| 185 // and |y_offset|. The effect is blended along the edge across |inset| | 185 void SetBackgroundZoom(float zoom, int inset); |
| 186 // pixels. | |
| 187 void SetBackgroundZoom(float x_offset, float y_offset, float zoom, int inset); | |
| 188 | 186 |
| 189 // Invert the layer. | 187 // Invert the layer. |
| 190 bool layer_inverted() const { return layer_inverted_; } | 188 bool layer_inverted() const { return layer_inverted_; } |
| 191 void SetLayerInverted(bool inverted); | 189 void SetLayerInverted(bool inverted); |
| 192 | 190 |
| 193 // Return the target opacity if animator is running, or the current opacity | 191 // Return the target opacity if animator is running, or the current opacity |
| 194 // otherwise. | 192 // otherwise. |
| 195 float GetTargetOpacity() const; | 193 float GetTargetOpacity() const; |
| 196 | 194 |
| 197 // Set a layer mask for a layer. | 195 // Set a layer mask for a layer. |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 float layer_grayscale_; | 412 float layer_grayscale_; |
| 415 bool layer_inverted_; | 413 bool layer_inverted_; |
| 416 | 414 |
| 417 // The associated mask layer with this layer. | 415 // The associated mask layer with this layer. |
| 418 Layer* layer_mask_; | 416 Layer* layer_mask_; |
| 419 // The back link from the mask layer to it's associated masked layer. | 417 // The back link from the mask layer to it's associated masked layer. |
| 420 // We keep this reference for the case that if the mask layer gets deleted | 418 // We keep this reference for the case that if the mask layer gets deleted |
| 421 // while attached to the main layer before the main layer is deleted. | 419 // while attached to the main layer before the main layer is deleted. |
| 422 Layer* layer_mask_back_link_; | 420 Layer* layer_mask_back_link_; |
| 423 | 421 |
| 424 // When the layer is zoomed, this is the offset to the upper left corner of | |
| 425 // the area in the layer that is zoomed. | |
| 426 float zoom_x_offset_; | |
| 427 float zoom_y_offset_; | |
| 428 | |
| 429 // The zoom factor to scale the layer by. Zooming is disabled when this is | 422 // The zoom factor to scale the layer by. Zooming is disabled when this is |
| 430 // set to 1. | 423 // set to 1. |
| 431 float zoom_; | 424 float zoom_; |
| 432 | 425 |
| 433 // Width of the border in pixels, where the scaling is blended. | 426 // Width of the border in pixels, where the scaling is blended. |
| 434 int zoom_inset_; | 427 int zoom_inset_; |
| 435 | 428 |
| 436 std::string name_; | 429 std::string name_; |
| 437 | 430 |
| 438 LayerDelegate* delegate_; | 431 LayerDelegate* delegate_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 461 // The size of the delegated frame in DIP, set when SetDelegatedFrame was | 454 // The size of the delegated frame in DIP, set when SetDelegatedFrame was |
| 462 // called. | 455 // called. |
| 463 gfx::Size delegated_frame_size_in_dip_; | 456 gfx::Size delegated_frame_size_in_dip_; |
| 464 | 457 |
| 465 DISALLOW_COPY_AND_ASSIGN(Layer); | 458 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 466 }; | 459 }; |
| 467 | 460 |
| 468 } // namespace ui | 461 } // namespace ui |
| 469 | 462 |
| 470 #endif // UI_COMPOSITOR_LAYER_H_ | 463 #endif // UI_COMPOSITOR_LAYER_H_ |
| OLD | NEW |