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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 gfx::Size frame_size_in_dip); | 275 gfx::Size frame_size_in_dip); |
276 | 276 |
277 // Begins showing content from a surface with a particular id. | 277 // Begins showing content from a surface with a particular id. |
278 void SetShowSurface(cc::SurfaceId id, gfx::Size frame_size_in_dip); | 278 void SetShowSurface(cc::SurfaceId id, gfx::Size frame_size_in_dip); |
279 | 279 |
280 bool has_external_content() { | 280 bool has_external_content() { |
281 return texture_layer_.get() || delegated_renderer_layer_.get() || | 281 return texture_layer_.get() || delegated_renderer_layer_.get() || |
282 surface_layer_.get(); | 282 surface_layer_.get(); |
283 } | 283 } |
284 | 284 |
285 void SetShowPaintedContent(); | 285 // Show a solid color instead of delegated or surface contents. |
| 286 void SetShowSolidColorContent(); |
286 | 287 |
287 // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR. | 288 // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR. |
288 void SetColor(SkColor color); | 289 void SetColor(SkColor color); |
289 | 290 |
290 // Updates the nine patch layer's bitmap, aperture and border. May only be | 291 // Updates the nine patch layer's bitmap, aperture and border. May only be |
291 // called for LAYER_NINE_PATCH. | 292 // called for LAYER_NINE_PATCH. |
292 void UpdateNinePatchLayerBitmap(const SkBitmap& bitmap); | 293 void UpdateNinePatchLayerBitmap(const SkBitmap& bitmap); |
293 void UpdateNinePatchLayerAperture(const gfx::Rect& aperture); | 294 void UpdateNinePatchLayerAperture(const gfx::Rect& aperture); |
294 void UpdateNinePatchLayerBorder(const gfx::Rect& border); | 295 void UpdateNinePatchLayerBorder(const gfx::Rect& border); |
295 | 296 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 virtual float GetBrightnessForAnimation() const OVERRIDE; | 391 virtual float GetBrightnessForAnimation() const OVERRIDE; |
391 virtual float GetGrayscaleForAnimation() const OVERRIDE; | 392 virtual float GetGrayscaleForAnimation() const OVERRIDE; |
392 virtual SkColor GetColorForAnimation() const OVERRIDE; | 393 virtual SkColor GetColorForAnimation() const OVERRIDE; |
393 virtual float GetDeviceScaleFactor() const OVERRIDE; | 394 virtual float GetDeviceScaleFactor() const OVERRIDE; |
394 virtual void AddThreadedAnimation( | 395 virtual void AddThreadedAnimation( |
395 scoped_ptr<cc::Animation> animation) OVERRIDE; | 396 scoped_ptr<cc::Animation> animation) OVERRIDE; |
396 virtual void RemoveThreadedAnimation(int animation_id) OVERRIDE; | 397 virtual void RemoveThreadedAnimation(int animation_id) OVERRIDE; |
397 virtual LayerAnimatorCollection* GetLayerAnimatorCollection() OVERRIDE; | 398 virtual LayerAnimatorCollection* GetLayerAnimatorCollection() OVERRIDE; |
398 | 399 |
399 // Creates a corresponding composited layer for |type_|. | 400 // Creates a corresponding composited layer for |type_|. |
400 void CreateWebLayer(); | 401 void CreateCcLayer(); |
401 | 402 |
402 // Recomputes and sets to |cc_layer_|. | 403 // Recomputes and sets to |cc_layer_|. |
403 void RecomputeDrawsContentAndUVRect(); | 404 void RecomputeDrawsContentAndUVRect(); |
404 void RecomputePosition(); | 405 void RecomputePosition(); |
405 | 406 |
406 // Set all filters which got applied to the layer. | 407 // Set all filters which got applied to the layer. |
407 void SetLayerFilters(); | 408 void SetLayerFilters(); |
408 | 409 |
409 // Set all filters which got applied to the layer background. | 410 // Set all filters which got applied to the layer background. |
410 void SetLayerBackgroundFilters(); | 411 void SetLayerBackgroundFilters(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 // The size of the frame or texture in DIP, set when SetShowDelegatedContent | 510 // The size of the frame or texture in DIP, set when SetShowDelegatedContent |
510 // or SetTextureMailbox was called. | 511 // or SetTextureMailbox was called. |
511 gfx::Size frame_size_in_dip_; | 512 gfx::Size frame_size_in_dip_; |
512 | 513 |
513 DISALLOW_COPY_AND_ASSIGN(Layer); | 514 DISALLOW_COPY_AND_ASSIGN(Layer); |
514 }; | 515 }; |
515 | 516 |
516 } // namespace ui | 517 } // namespace ui |
517 | 518 |
518 #endif // UI_COMPOSITOR_LAYER_H_ | 519 #endif // UI_COMPOSITOR_LAYER_H_ |
OLD | NEW |