Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: ui/compositor/layer.h

Issue 15001027: [Aura] Added Support for rendering software compositor frames as cc::TextureLayers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/message_loop.h" 14 #include "base/message_loop.h"
15 #include "cc/animation/animation_events.h" 15 #include "cc/animation/animation_events.h"
16 #include "cc/animation/layer_animation_event_observer.h" 16 #include "cc/animation/layer_animation_event_observer.h"
17 #include "cc/base/scoped_ptr_vector.h" 17 #include "cc/base/scoped_ptr_vector.h"
18 #include "cc/layers/content_layer_client.h" 18 #include "cc/layers/content_layer_client.h"
19 #include "cc/layers/texture_layer_client.h" 19 #include "cc/layers/texture_layer_client.h"
20 #include "cc/resources/texture_mailbox.h"
20 #include "third_party/skia/include/core/SkColor.h" 21 #include "third_party/skia/include/core/SkColor.h"
21 #include "third_party/skia/include/core/SkRegion.h" 22 #include "third_party/skia/include/core/SkRegion.h"
22 #include "ui/compositor/compositor.h" 23 #include "ui/compositor/compositor.h"
23 #include "ui/compositor/layer_animation_delegate.h" 24 #include "ui/compositor/layer_animation_delegate.h"
24 #include "ui/compositor/layer_delegate.h" 25 #include "ui/compositor/layer_delegate.h"
25 #include "ui/compositor/layer_type.h" 26 #include "ui/compositor/layer_type.h"
26 #include "ui/gfx/rect.h" 27 #include "ui/gfx/rect.h"
27 #include "ui/gfx/transform.h" 28 #include "ui/gfx/transform.h"
28 29
29 class SkCanvas; 30 class SkCanvas;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 const std::string& name() const { return name_; } 244 const std::string& name() const { return name_; }
244 void set_name(const std::string& name) { name_ = name; } 245 void set_name(const std::string& name) { name_ = name; }
245 246
246 const ui::Texture* texture() const { return texture_.get(); } 247 const ui::Texture* texture() const { return texture_.get(); }
247 248
248 // Assigns a new external texture. |texture| can be NULL to disable external 249 // Assigns a new external texture. |texture| can be NULL to disable external
249 // updates. 250 // updates.
250 void SetExternalTexture(ui::Texture* texture); 251 void SetExternalTexture(ui::Texture* texture);
251 ui::Texture* external_texture() { return texture_.get(); } 252 ui::Texture* external_texture() { return texture_.get(); }
252 253
254 void SetTextureMailbox(const cc::TextureMailbox& mailbox,
piman 2013/05/28 20:58:57 nit: comment.
slavi 2013/05/29 18:31:48 Done.
255 float device_scale_factor);
256
253 // Sets a delegated frame, coming from a child compositor. 257 // Sets a delegated frame, coming from a child compositor.
254 void SetDelegatedFrame(scoped_ptr<cc::DelegatedFrameData> frame, 258 void SetDelegatedFrame(scoped_ptr<cc::DelegatedFrameData> frame,
255 gfx::Size frame_size_in_dip); 259 gfx::Size frame_size_in_dip);
256 260
257 // Gets unused resources to recycle to the child compositor. 261 // Gets unused resources to recycle to the child compositor.
258 void TakeUnusedResourcesForChildCompositor( 262 void TakeUnusedResourcesForChildCompositor(
259 cc::TransferableResourceArray* array); 263 cc::TransferableResourceArray* array);
260 264
261 // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR. 265 // Sets the layer's fill color. May only be called for LAYER_SOLID_COLOR.
262 void SetColor(SkColor color); 266 void SetColor(SkColor color);
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 scoped_refptr<cc::DelegatedRendererLayer> delegated_renderer_layer_; 462 scoped_refptr<cc::DelegatedRendererLayer> delegated_renderer_layer_;
459 cc::Layer* cc_layer_; 463 cc::Layer* cc_layer_;
460 464
461 // If true, the layer scales the canvas and the texture with the device scale 465 // If true, the layer scales the canvas and the texture with the device scale
462 // factor as appropriate. When true, the texture size is in DIP. 466 // factor as appropriate. When true, the texture size is in DIP.
463 bool scale_content_; 467 bool scale_content_;
464 468
465 // A cached copy of |Compositor::device_scale_factor()|. 469 // A cached copy of |Compositor::device_scale_factor()|.
466 float device_scale_factor_; 470 float device_scale_factor_;
467 471
472 // A cached copy of the TextureMailbox given texture_layer_.
473 cc::TextureMailbox mailbox_;
474
475 // Device scale factor in which mailbox_ was rendered in.
476 float mailbox_scale_factor_;
477
468 // The size of the delegated frame in DIP, set when SetDelegatedFrame was 478 // The size of the delegated frame in DIP, set when SetDelegatedFrame was
469 // called. 479 // called.
470 gfx::Size delegated_frame_size_in_dip_; 480 gfx::Size delegated_frame_size_in_dip_;
471 481
472 DISALLOW_COPY_AND_ASSIGN(Layer); 482 DISALLOW_COPY_AND_ASSIGN(Layer);
473 }; 483 };
474 484
475 } // namespace ui 485 } // namespace ui
476 486
477 #endif // UI_COMPOSITOR_LAYER_H_ 487 #endif // UI_COMPOSITOR_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698