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

Side by Side Diff: cc/layers/layer.h

Issue 465853004: Moving RenderSurface creation outside of CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 CC_LAYERS_LAYER_H_ 5 #ifndef CC_LAYERS_LAYER_H_
6 #define CC_LAYERS_LAYER_H_ 6 #define CC_LAYERS_LAYER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 bool IsContainerForFixedPositionLayers() const; 170 bool IsContainerForFixedPositionLayers() const;
171 171
172 void SetPositionConstraint(const LayerPositionConstraint& constraint); 172 void SetPositionConstraint(const LayerPositionConstraint& constraint);
173 const LayerPositionConstraint& position_constraint() const { 173 const LayerPositionConstraint& position_constraint() const {
174 return position_constraint_; 174 return position_constraint_;
175 } 175 }
176 176
177 void SetTransform(const gfx::Transform& transform); 177 void SetTransform(const gfx::Transform& transform);
178 const gfx::Transform& transform() const { return transform_; } 178 const gfx::Transform& transform() const { return transform_; }
179 bool TransformIsAnimating() const; 179 bool TransformIsAnimating() const;
180 bool HasNotAxisAlignedTransformAnimation() const;
180 bool transform_is_invertible() const { return transform_is_invertible_; } 181 bool transform_is_invertible() const { return transform_is_invertible_; }
181 182
182 void SetTransformOrigin(const gfx::Point3F&); 183 void SetTransformOrigin(const gfx::Point3F&);
183 gfx::Point3F transform_origin() { return transform_origin_; } 184 gfx::Point3F transform_origin() { return transform_origin_; }
184 185
185 void SetScrollParent(Layer* parent); 186 void SetScrollParent(Layer* parent);
186 187
187 Layer* scroll_parent() { return scroll_parent_; } 188 Layer* scroll_parent() { return scroll_parent_; }
188 const Layer* scroll_parent() const { return scroll_parent_; } 189 const Layer* scroll_parent() const { return scroll_parent_; }
189 190
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 Layer* render_target() { 249 Layer* render_target() {
249 DCHECK(!draw_properties_.render_target || 250 DCHECK(!draw_properties_.render_target ||
250 draw_properties_.render_target->render_surface()); 251 draw_properties_.render_target->render_surface());
251 return draw_properties_.render_target; 252 return draw_properties_.render_target;
252 } 253 }
253 const Layer* render_target() const { 254 const Layer* render_target() const {
254 DCHECK(!draw_properties_.render_target || 255 DCHECK(!draw_properties_.render_target ||
255 draw_properties_.render_target->render_surface()); 256 draw_properties_.render_target->render_surface());
256 return draw_properties_.render_target; 257 return draw_properties_.render_target;
257 } 258 }
258 RenderSurface* render_surface() const {
259 return draw_properties_.render_surface.get();
260 }
261 int num_unclipped_descendants() const { 259 int num_unclipped_descendants() const {
262 return draw_properties_.num_unclipped_descendants; 260 return draw_properties_.num_unclipped_descendants;
263 } 261 }
264 262
263 RenderSurface* render_surface() const { return render_surface_.get(); }
265 void SetScrollOffset(const gfx::ScrollOffset& scroll_offset); 264 void SetScrollOffset(const gfx::ScrollOffset& scroll_offset);
266 gfx::ScrollOffset scroll_offset() const { return scroll_offset_; } 265 gfx::ScrollOffset scroll_offset() const { return scroll_offset_; }
267 void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset); 266 void SetScrollOffsetFromImplSide(const gfx::ScrollOffset& scroll_offset);
268 267
269 void SetScrollClipLayerId(int clip_layer_id); 268 void SetScrollClipLayerId(int clip_layer_id);
270 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; } 269 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; }
271 270
272 void SetUserScrollable(bool horizontal, bool vertical); 271 void SetUserScrollable(bool horizontal, bool vertical);
273 bool user_scrollable_horizontal() const { 272 bool user_scrollable_horizontal() const {
274 return user_scrollable_horizontal_; 273 return user_scrollable_horizontal_;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 virtual bool IsSuitableForGpuRasterization() const; 368 virtual bool IsSuitableForGpuRasterization() const;
370 369
371 virtual scoped_refptr<base::debug::ConvertableToTraceFormat> TakeDebugInfo(); 370 virtual scoped_refptr<base::debug::ConvertableToTraceFormat> TakeDebugInfo();
372 371
373 void SetLayerClient(LayerClient* client) { client_ = client; } 372 void SetLayerClient(LayerClient* client) { client_ = client; }
374 373
375 virtual void PushPropertiesTo(LayerImpl* layer); 374 virtual void PushPropertiesTo(LayerImpl* layer);
376 375
377 void CreateRenderSurface(); 376 void CreateRenderSurface();
378 void ClearRenderSurface(); 377 void ClearRenderSurface();
378
379 // This should only be called during BeginMainFrame since it does not
380 // trigger a Commit.
381 void SetHasRenderSurface(bool has_render_surface);
382
379 void ClearRenderSurfaceLayerList(); 383 void ClearRenderSurfaceLayerList();
380 384
381 // The contents scale converts from logical, non-page-scaled pixels to target 385 // The contents scale converts from logical, non-page-scaled pixels to target
382 // pixels. The contents scale is 1 for the root layer as it is already in 386 // pixels. The contents scale is 1 for the root layer as it is already in
383 // physical pixels. By default contents scale is forced to be 1 except for 387 // physical pixels. By default contents scale is forced to be 1 except for
384 // subclasses of ContentsScalingLayer. 388 // subclasses of ContentsScalingLayer.
385 float contents_scale_x() const { return draw_properties_.contents_scale_x; } 389 float contents_scale_x() const { return draw_properties_.contents_scale_x; }
386 float contents_scale_y() const { return draw_properties_.contents_scale_y; } 390 float contents_scale_y() const { return draw_properties_.contents_scale_y; }
387 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } 391 gfx::Size content_bounds() const { return draw_properties_.content_bounds; }
388 392
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 bool draws_content_ : 1; 604 bool draws_content_ : 1;
601 bool hide_layer_and_subtree_ : 1; 605 bool hide_layer_and_subtree_ : 1;
602 bool masks_to_bounds_ : 1; 606 bool masks_to_bounds_ : 1;
603 bool contents_opaque_ : 1; 607 bool contents_opaque_ : 1;
604 bool double_sided_ : 1; 608 bool double_sided_ : 1;
605 bool should_flatten_transform_ : 1; 609 bool should_flatten_transform_ : 1;
606 bool use_parent_backface_visibility_ : 1; 610 bool use_parent_backface_visibility_ : 1;
607 bool draw_checkerboard_for_missing_tiles_ : 1; 611 bool draw_checkerboard_for_missing_tiles_ : 1;
608 bool force_render_surface_ : 1; 612 bool force_render_surface_ : 1;
609 bool transform_is_invertible_ : 1; 613 bool transform_is_invertible_ : 1;
614 bool has_render_surface_ : 1;
610 Region non_fast_scrollable_region_; 615 Region non_fast_scrollable_region_;
611 Region touch_event_handler_region_; 616 Region touch_event_handler_region_;
612 gfx::PointF position_; 617 gfx::PointF position_;
613 SkColor background_color_; 618 SkColor background_color_;
614 float opacity_; 619 float opacity_;
615 SkXfermode::Mode blend_mode_; 620 SkXfermode::Mode blend_mode_;
616 FilterOperations filters_; 621 FilterOperations filters_;
617 FilterOperations background_filters_; 622 FilterOperations background_filters_;
618 LayerPositionConstraint position_constraint_; 623 LayerPositionConstraint position_constraint_;
619 Layer* scroll_parent_; 624 Layer* scroll_parent_;
(...skipping 13 matching lines...) Expand all
633 638
634 LayerClient* client_; 639 LayerClient* client_;
635 640
636 ScopedPtrVector<CopyOutputRequest> copy_requests_; 641 ScopedPtrVector<CopyOutputRequest> copy_requests_;
637 642
638 base::Closure did_scroll_callback_; 643 base::Closure did_scroll_callback_;
639 644
640 DrawProperties<Layer> draw_properties_; 645 DrawProperties<Layer> draw_properties_;
641 646
642 PaintProperties paint_properties_; 647 PaintProperties paint_properties_;
648 scoped_ptr<RenderSurface> render_surface_;
643 649
644 DISALLOW_COPY_AND_ASSIGN(Layer); 650 DISALLOW_COPY_AND_ASSIGN(Layer);
645 }; 651 };
646 652
647 } // namespace cc 653 } // namespace cc
648 654
649 #endif // CC_LAYERS_LAYER_H_ 655 #endif // CC_LAYERS_LAYER_H_
OLDNEW
« no previous file with comments | « cc/layers/draw_properties.h ('k') | cc/layers/layer.cc » ('j') | cc/layers/layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698