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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 // Converts a transform to be relative to the given |ancestor|. Returns | 227 // Converts a transform to be relative to the given |ancestor|. Returns |
228 // whether success (that is, whether the given ancestor was really an | 228 // whether success (that is, whether the given ancestor was really an |
229 // ancestor of this layer). | 229 // ancestor of this layer). |
230 bool GetTargetTransformRelativeTo(const Layer* ancestor, | 230 bool GetTargetTransformRelativeTo(const Layer* ancestor, |
231 gfx::Transform* transform) const; | 231 gfx::Transform* transform) const; |
232 | 232 |
233 // Converts a ui::Layer's transform to the transform on the corresponding | 233 // Converts a ui::Layer's transform to the transform on the corresponding |
234 // cc::Layer. | 234 // cc::Layer. |
235 static gfx::Transform ConvertTransformToCCTransform( | 235 static gfx::Transform ConvertTransformToCCTransform( |
236 const gfx::Transform& transform, | 236 const gfx::Transform& transform, |
237 const gfx::Rect& bounds, | |
238 float device_scale_factor); | 237 float device_scale_factor); |
239 | 238 |
240 // See description in View for details | 239 // See description in View for details |
241 void SetFillsBoundsOpaquely(bool fills_bounds_opaquely); | 240 void SetFillsBoundsOpaquely(bool fills_bounds_opaquely); |
242 bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; } | 241 bool fills_bounds_opaquely() const { return fills_bounds_opaquely_; } |
243 | 242 |
244 const std::string& name() const { return name_; } | 243 const std::string& name() const { return name_; } |
245 void set_name(const std::string& name) { name_ = name; } | 244 void set_name(const std::string& name) { name_ = name; } |
246 | 245 |
247 const ui::Texture* texture() const { return texture_.get(); } | 246 const ui::Texture* texture() const { return texture_.get(); } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 virtual float GetGrayscaleForAnimation() const OVERRIDE; | 361 virtual float GetGrayscaleForAnimation() const OVERRIDE; |
363 virtual SkColor GetColorForAnimation() const OVERRIDE; | 362 virtual SkColor GetColorForAnimation() const OVERRIDE; |
364 virtual float GetDeviceScaleFactor() const OVERRIDE; | 363 virtual float GetDeviceScaleFactor() const OVERRIDE; |
365 virtual void AddThreadedAnimation( | 364 virtual void AddThreadedAnimation( |
366 scoped_ptr<cc::Animation> animation) OVERRIDE; | 365 scoped_ptr<cc::Animation> animation) OVERRIDE; |
367 virtual void RemoveThreadedAnimation(int animation_id) OVERRIDE; | 366 virtual void RemoveThreadedAnimation(int animation_id) OVERRIDE; |
368 | 367 |
369 void CreateWebLayer(); | 368 void CreateWebLayer(); |
370 void RecomputeCCTransformFromTransform(const gfx::Transform& transform); | 369 void RecomputeCCTransformFromTransform(const gfx::Transform& transform); |
371 void RecomputeDrawsContentAndUVRect(); | 370 void RecomputeDrawsContentAndUVRect(); |
| 371 void RecomputePosition(); |
372 | 372 |
373 // Set all filters which got applied to the layer. | 373 // Set all filters which got applied to the layer. |
374 void SetLayerFilters(); | 374 void SetLayerFilters(); |
375 | 375 |
376 // Set all filters which got applied to the layer background. | 376 // Set all filters which got applied to the layer background. |
377 void SetLayerBackgroundFilters(); | 377 void SetLayerBackgroundFilters(); |
378 | 378 |
379 void UpdateIsDrawn(); | 379 void UpdateIsDrawn(); |
380 | 380 |
381 void SwitchToLayer(scoped_refptr<cc::Layer> new_layer); | 381 void SwitchToLayer(scoped_refptr<cc::Layer> new_layer); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 // The size of the delegated frame in DIP, set when SetDelegatedFrame was | 467 // The size of the delegated frame in DIP, set when SetDelegatedFrame was |
468 // called. | 468 // called. |
469 gfx::Size delegated_frame_size_in_dip_; | 469 gfx::Size delegated_frame_size_in_dip_; |
470 | 470 |
471 DISALLOW_COPY_AND_ASSIGN(Layer); | 471 DISALLOW_COPY_AND_ASSIGN(Layer); |
472 }; | 472 }; |
473 | 473 |
474 } // namespace ui | 474 } // namespace ui |
475 | 475 |
476 #endif // UI_COMPOSITOR_LAYER_H_ | 476 #endif // UI_COMPOSITOR_LAYER_H_ |
OLD | NEW |