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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 // The opacity of the layer. The opacity is applied to each pixel of the | 180 // The opacity of the layer. The opacity is applied to each pixel of the |
181 // texture (resulting alpha = opacity * alpha). | 181 // texture (resulting alpha = opacity * alpha). |
182 float opacity() const; | 182 float opacity() const; |
183 void SetOpacity(float opacity); | 183 void SetOpacity(float opacity); |
184 | 184 |
185 // Returns the actual opacity, which the opacity of this layer multipled by | 185 // Returns the actual opacity, which the opacity of this layer multipled by |
186 // the combined opacity of the parent. | 186 // the combined opacity of the parent. |
187 float GetCombinedOpacity() const; | 187 float GetCombinedOpacity() const; |
188 | 188 |
| 189 // The layer temperature value between 0.0f and 1.0f, where a value of 0.0f |
| 190 // is least warm (which is the default), and a value of 1.0f is most warm. |
| 191 float layer_temperature() const { return layer_temperature_; } |
| 192 void SetLayerTemperature(float value); |
| 193 |
189 // Blur pixels by this amount in anything below the layer and visible through | 194 // Blur pixels by this amount in anything below the layer and visible through |
190 // the layer. | 195 // the layer. |
191 int background_blur() const { return background_blur_radius_; } | 196 int background_blur() const { return background_blur_radius_; } |
192 void SetBackgroundBlur(int blur_radius); | 197 void SetBackgroundBlur(int blur_radius); |
193 | 198 |
194 // Saturate all pixels of this layer by this amount. | 199 // Saturate all pixels of this layer by this amount. |
195 // This effect will get "combined" with the inverted, | 200 // This effect will get "combined" with the inverted, |
196 // brightness and grayscale setting. | 201 // brightness and grayscale setting. |
197 float layer_saturation() const { return layer_saturation_; } | 202 float layer_saturation() const { return layer_saturation_; } |
198 void SetLayerSaturation(float saturation); | 203 void SetLayerSaturation(float saturation); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 bool ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const; | 419 bool ConvertPointFromAncestor(const Layer* ancestor, gfx::Point* point) const; |
415 | 420 |
416 // Implementation of LayerAnimatorDelegate | 421 // Implementation of LayerAnimatorDelegate |
417 void SetBoundsFromAnimation(const gfx::Rect& bounds) override; | 422 void SetBoundsFromAnimation(const gfx::Rect& bounds) override; |
418 void SetTransformFromAnimation(const gfx::Transform& transform) override; | 423 void SetTransformFromAnimation(const gfx::Transform& transform) override; |
419 void SetOpacityFromAnimation(float opacity) override; | 424 void SetOpacityFromAnimation(float opacity) override; |
420 void SetVisibilityFromAnimation(bool visibility) override; | 425 void SetVisibilityFromAnimation(bool visibility) override; |
421 void SetBrightnessFromAnimation(float brightness) override; | 426 void SetBrightnessFromAnimation(float brightness) override; |
422 void SetGrayscaleFromAnimation(float grayscale) override; | 427 void SetGrayscaleFromAnimation(float grayscale) override; |
423 void SetColorFromAnimation(SkColor color) override; | 428 void SetColorFromAnimation(SkColor color) override; |
| 429 void SetTemperatureFromAnimation(float temperature) override; |
424 void ScheduleDrawForAnimation() override; | 430 void ScheduleDrawForAnimation() override; |
425 const gfx::Rect& GetBoundsForAnimation() const override; | 431 const gfx::Rect& GetBoundsForAnimation() const override; |
426 gfx::Transform GetTransformForAnimation() const override; | 432 gfx::Transform GetTransformForAnimation() const override; |
427 float GetOpacityForAnimation() const override; | 433 float GetOpacityForAnimation() const override; |
428 bool GetVisibilityForAnimation() const override; | 434 bool GetVisibilityForAnimation() const override; |
429 float GetBrightnessForAnimation() const override; | 435 float GetBrightnessForAnimation() const override; |
430 float GetGrayscaleForAnimation() const override; | 436 float GetGrayscaleForAnimation() const override; |
431 SkColor GetColorForAnimation() const override; | 437 SkColor GetColorForAnimation() const override; |
| 438 float GetTemperatureFromAnimation() const override; |
432 float GetDeviceScaleFactor() const override; | 439 float GetDeviceScaleFactor() const override; |
433 cc::Layer* GetCcLayer() const override; | 440 cc::Layer* GetCcLayer() const override; |
434 LayerThreadedAnimationDelegate* GetThreadedAnimationDelegate() override; | 441 LayerThreadedAnimationDelegate* GetThreadedAnimationDelegate() override; |
435 LayerAnimatorCollection* GetLayerAnimatorCollection() override; | 442 LayerAnimatorCollection* GetLayerAnimatorCollection() override; |
436 int GetFrameNumber() const override; | 443 int GetFrameNumber() const override; |
437 float GetRefreshRate() const override; | 444 float GetRefreshRate() const override; |
438 | 445 |
439 // Creates a corresponding composited layer for |type_|. | 446 // Creates a corresponding composited layer for |type_|. |
440 void CreateCcLayer(); | 447 void CreateCcLayer(); |
441 | 448 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 | 499 |
493 int background_blur_radius_; | 500 int background_blur_radius_; |
494 | 501 |
495 // Several variables which will change the visible representation of | 502 // Several variables which will change the visible representation of |
496 // the layer. | 503 // the layer. |
497 float layer_saturation_; | 504 float layer_saturation_; |
498 float layer_brightness_; | 505 float layer_brightness_; |
499 float layer_grayscale_; | 506 float layer_grayscale_; |
500 bool layer_inverted_; | 507 bool layer_inverted_; |
501 | 508 |
| 509 // The global color temperature value (0.0f ~ 1.0f). Used to calculate the |
| 510 // layer blue and green colors scales. 0.0f is least warm (default), and 1.0f |
| 511 // is most warm. |
| 512 float layer_temperature_; |
| 513 // The calculated layer blue and green color scales (0.0f ~ 1.0f). |
| 514 float layer_blue_scale_; |
| 515 float layer_green_scale_; |
| 516 |
502 // The associated mask layer with this layer. | 517 // The associated mask layer with this layer. |
503 Layer* layer_mask_; | 518 Layer* layer_mask_; |
504 // The back link from the mask layer to it's associated masked layer. | 519 // The back link from the mask layer to it's associated masked layer. |
505 // We keep this reference for the case that if the mask layer gets deleted | 520 // We keep this reference for the case that if the mask layer gets deleted |
506 // while attached to the main layer before the main layer is deleted. | 521 // while attached to the main layer before the main layer is deleted. |
507 Layer* layer_mask_back_link_; | 522 Layer* layer_mask_back_link_; |
508 | 523 |
509 // The zoom factor to scale the layer by. Zooming is disabled when this is | 524 // The zoom factor to scale the layer by. Zooming is disabled when this is |
510 // set to 1. | 525 // set to 1. |
511 float zoom_; | 526 float zoom_; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 // The size of the frame or texture in DIP, set when SetShowDelegatedContent | 568 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
554 // or SetTextureMailbox was called. | 569 // or SetTextureMailbox was called. |
555 gfx::Size frame_size_in_dip_; | 570 gfx::Size frame_size_in_dip_; |
556 | 571 |
557 DISALLOW_COPY_AND_ASSIGN(Layer); | 572 DISALLOW_COPY_AND_ASSIGN(Layer); |
558 }; | 573 }; |
559 | 574 |
560 } // namespace ui | 575 } // namespace ui |
561 | 576 |
562 #endif // UI_COMPOSITOR_LAYER_H_ | 577 #endif // UI_COMPOSITOR_LAYER_H_ |
OLD | NEW |