| 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 15 matching lines...) Expand all Loading... |
| 26 #include "ui/compositor/layer_delegate.h" | 26 #include "ui/compositor/layer_delegate.h" |
| 27 #include "ui/compositor/layer_type.h" | 27 #include "ui/compositor/layer_type.h" |
| 28 #include "ui/gfx/rect.h" | 28 #include "ui/gfx/rect.h" |
| 29 #include "ui/gfx/transform.h" | 29 #include "ui/gfx/transform.h" |
| 30 | 30 |
| 31 class SkCanvas; | 31 class SkCanvas; |
| 32 | 32 |
| 33 namespace cc { | 33 namespace cc { |
| 34 class ContentLayer; | 34 class ContentLayer; |
| 35 class CopyOutputRequest; | 35 class CopyOutputRequest; |
| 36 class DelegatedFrameData; | 36 class DelegatedFrameProvider; |
| 37 class DelegatedRendererLayer; | 37 class DelegatedRendererLayer; |
| 38 class Layer; | 38 class Layer; |
| 39 class ResourceUpdateQueue; | 39 class ResourceUpdateQueue; |
| 40 class SolidColorLayer; | 40 class SolidColorLayer; |
| 41 class TextureLayer; | 41 class TextureLayer; |
| 42 struct ReturnedResource; | 42 struct ReturnedResource; |
| 43 typedef std::vector<ReturnedResource> ReturnedResourceArray; | 43 typedef std::vector<ReturnedResource> ReturnedResourceArray; |
| 44 } | 44 } |
| 45 | 45 |
| 46 namespace ui { | 46 namespace ui { |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 void SetExternalTexture(ui::Texture* texture); | 254 void SetExternalTexture(ui::Texture* texture); |
| 255 ui::Texture* external_texture() { return texture_.get(); } | 255 ui::Texture* external_texture() { return texture_.get(); } |
| 256 | 256 |
| 257 // Set new TextureMailbox for this layer. Note that |mailbox| may hold a | 257 // Set new TextureMailbox for this layer. Note that |mailbox| may hold a |
| 258 // shared memory resource or an actual mailbox for a texture. | 258 // shared memory resource or an actual mailbox for a texture. |
| 259 void SetTextureMailbox(const cc::TextureMailbox& mailbox, | 259 void SetTextureMailbox(const cc::TextureMailbox& mailbox, |
| 260 scoped_ptr<cc::SingleReleaseCallback> release_callback, | 260 scoped_ptr<cc::SingleReleaseCallback> release_callback, |
| 261 float scale_factor); | 261 float scale_factor); |
| 262 cc::TextureMailbox GetTextureMailbox(float* scale_factor); | 262 cc::TextureMailbox GetTextureMailbox(float* scale_factor); |
| 263 | 263 |
| 264 // Sets a delegated frame, coming from a child compositor. | 264 // Begins showing delegated frames from the |frame_provider|. |
| 265 void SetDelegatedFrame(scoped_ptr<cc::DelegatedFrameData> frame, | 265 void SetShowDelegatedContent(cc::DelegatedFrameProvider* frame_provider, |
| 266 gfx::Size frame_size_in_dip); | 266 gfx::Size frame_size_in_dip); |
| 267 | 267 |
| 268 bool has_external_content() { | 268 bool has_external_content() { |
| 269 return texture_layer_.get() || delegated_renderer_layer_.get(); | 269 return texture_layer_.get() || delegated_renderer_layer_.get(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 // Gets unused resources to recycle to the child compositor. | |
| 273 void TakeUnusedResourcesForChildCompositor( | |
| 274 cc::ReturnedResourceArray* array); | |
| 275 | |
| 276 void SetShowPaintedContent(); | 272 void SetShowPaintedContent(); |
| 277 | 273 |
| 278 // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR. | 274 // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR. |
| 279 void SetColor(SkColor color); | 275 void SetColor(SkColor color); |
| 280 | 276 |
| 281 // Adds |invalid_rect| to the Layer's pending invalid rect and calls | 277 // Adds |invalid_rect| to the Layer's pending invalid rect and calls |
| 282 // ScheduleDraw(). Returns false if the paint request is ignored. | 278 // ScheduleDraw(). Returns false if the paint request is ignored. |
| 283 bool SchedulePaint(const gfx::Rect& invalid_rect); | 279 bool SchedulePaint(const gfx::Rect& invalid_rect); |
| 284 | 280 |
| 285 // Schedules a redraw of the layer tree at the compositor. | 281 // Schedules a redraw of the layer tree at the compositor. |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 | 483 |
| 488 // A cached copy of |Compositor::device_scale_factor()|. | 484 // A cached copy of |Compositor::device_scale_factor()|. |
| 489 float device_scale_factor_; | 485 float device_scale_factor_; |
| 490 | 486 |
| 491 // A cached copy of the TextureMailbox given texture_layer_. | 487 // A cached copy of the TextureMailbox given texture_layer_. |
| 492 cc::TextureMailbox mailbox_; | 488 cc::TextureMailbox mailbox_; |
| 493 | 489 |
| 494 // Device scale factor in which mailbox_ was rendered in. | 490 // Device scale factor in which mailbox_ was rendered in. |
| 495 float mailbox_scale_factor_; | 491 float mailbox_scale_factor_; |
| 496 | 492 |
| 497 // The size of the delegated frame in DIP, set when SetDelegatedFrame was | 493 // The size of the delegated frame in DIP, set when SetShowDelegatedContent |
| 498 // called. | 494 // was called. |
| 499 gfx::Size delegated_frame_size_in_dip_; | 495 gfx::Size delegated_frame_size_in_dip_; |
| 500 | 496 |
| 501 DISALLOW_COPY_AND_ASSIGN(Layer); | 497 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 502 }; | 498 }; |
| 503 | 499 |
| 504 } // namespace ui | 500 } // namespace ui |
| 505 | 501 |
| 506 #endif // UI_COMPOSITOR_LAYER_H_ | 502 #endif // UI_COMPOSITOR_LAYER_H_ |
| OLD | NEW |