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

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, 3 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
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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 Layer* render_target() { 247 Layer* render_target() {
248 DCHECK(!draw_properties_.render_target || 248 DCHECK(!draw_properties_.render_target ||
249 draw_properties_.render_target->render_surface()); 249 draw_properties_.render_target->render_surface());
250 return draw_properties_.render_target; 250 return draw_properties_.render_target;
251 } 251 }
252 const Layer* render_target() const { 252 const Layer* render_target() const {
253 DCHECK(!draw_properties_.render_target || 253 DCHECK(!draw_properties_.render_target ||
254 draw_properties_.render_target->render_surface()); 254 draw_properties_.render_target->render_surface());
255 return draw_properties_.render_target; 255 return draw_properties_.render_target;
256 } 256 }
257 RenderSurface* render_surface() const {
258 return draw_properties_.render_surface.get();
259 }
260 int num_unclipped_descendants() const { 257 int num_unclipped_descendants() const {
261 return draw_properties_.num_unclipped_descendants; 258 return draw_properties_.num_unclipped_descendants;
262 } 259 }
263 260
261 RenderSurface* render_surface() const { return render_surface_.get(); }
264 void SetScrollOffset(gfx::Vector2d scroll_offset); 262 void SetScrollOffset(gfx::Vector2d scroll_offset);
265 gfx::Vector2d scroll_offset() const { return scroll_offset_; } 263 gfx::Vector2d scroll_offset() const { return scroll_offset_; }
266 void SetScrollOffsetFromImplSide(const gfx::Vector2d& scroll_offset); 264 void SetScrollOffsetFromImplSide(const gfx::Vector2d& scroll_offset);
267 265
268 void SetScrollClipLayerId(int clip_layer_id); 266 void SetScrollClipLayerId(int clip_layer_id);
269 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; } 267 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; }
270 268
271 void SetUserScrollable(bool horizontal, bool vertical); 269 void SetUserScrollable(bool horizontal, bool vertical);
272 bool user_scrollable_horizontal() const { 270 bool user_scrollable_horizontal() const {
273 return user_scrollable_horizontal_; 271 return user_scrollable_horizontal_;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 virtual bool IsSuitableForGpuRasterization() const; 367 virtual bool IsSuitableForGpuRasterization() const;
370 368
371 virtual scoped_refptr<base::debug::ConvertableToTraceFormat> TakeDebugInfo(); 369 virtual scoped_refptr<base::debug::ConvertableToTraceFormat> TakeDebugInfo();
372 370
373 void SetLayerClient(LayerClient* client) { client_ = client; } 371 void SetLayerClient(LayerClient* client) { client_ = client; }
374 372
375 virtual void PushPropertiesTo(LayerImpl* layer); 373 virtual void PushPropertiesTo(LayerImpl* layer);
376 374
377 void CreateRenderSurface(); 375 void CreateRenderSurface();
378 void ClearRenderSurface(); 376 void ClearRenderSurface();
377
378 // We do not trigger a Commit when this is called since we calculate
danakj 2014/09/03 19:30:33 Can this comment instead say "This should only be
awoloszyn 2014/09/09 15:31:35 Done.
379 // RenderSurface creation during the commit in CalculateDrawProperties.
380 void SetHasRenderSurface(bool has_render_surface);
381
379 void ClearRenderSurfaceLayerList(); 382 void ClearRenderSurfaceLayerList();
380 383
381 // The contents scale converts from logical, non-page-scaled pixels to target 384 // 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 385 // 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 386 // physical pixels. By default contents scale is forced to be 1 except for
384 // subclasses of ContentsScalingLayer. 387 // subclasses of ContentsScalingLayer.
385 float contents_scale_x() const { return draw_properties_.contents_scale_x; } 388 float contents_scale_x() const { return draw_properties_.contents_scale_x; }
386 float contents_scale_y() const { return draw_properties_.contents_scale_y; } 389 float contents_scale_y() const { return draw_properties_.contents_scale_y; }
387 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } 390 gfx::Size content_bounds() const { return draw_properties_.content_bounds; }
388 391
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 bool draws_content_ : 1; 604 bool draws_content_ : 1;
602 bool hide_layer_and_subtree_ : 1; 605 bool hide_layer_and_subtree_ : 1;
603 bool masks_to_bounds_ : 1; 606 bool masks_to_bounds_ : 1;
604 bool contents_opaque_ : 1; 607 bool contents_opaque_ : 1;
605 bool double_sided_ : 1; 608 bool double_sided_ : 1;
606 bool should_flatten_transform_ : 1; 609 bool should_flatten_transform_ : 1;
607 bool use_parent_backface_visibility_ : 1; 610 bool use_parent_backface_visibility_ : 1;
608 bool draw_checkerboard_for_missing_tiles_ : 1; 611 bool draw_checkerboard_for_missing_tiles_ : 1;
609 bool force_render_surface_ : 1; 612 bool force_render_surface_ : 1;
610 bool transform_is_invertible_ : 1; 613 bool transform_is_invertible_ : 1;
614 bool has_render_surface_ : 1;
611 Region non_fast_scrollable_region_; 615 Region non_fast_scrollable_region_;
612 Region touch_event_handler_region_; 616 Region touch_event_handler_region_;
613 gfx::PointF position_; 617 gfx::PointF position_;
614 SkColor background_color_; 618 SkColor background_color_;
615 float opacity_; 619 float opacity_;
616 SkXfermode::Mode blend_mode_; 620 SkXfermode::Mode blend_mode_;
617 FilterOperations filters_; 621 FilterOperations filters_;
618 FilterOperations background_filters_; 622 FilterOperations background_filters_;
619 LayerPositionConstraint position_constraint_; 623 LayerPositionConstraint position_constraint_;
620 Layer* scroll_parent_; 624 Layer* scroll_parent_;
(...skipping 13 matching lines...) Expand all
634 638
635 LayerClient* client_; 639 LayerClient* client_;
636 640
637 ScopedPtrVector<CopyOutputRequest> copy_requests_; 641 ScopedPtrVector<CopyOutputRequest> copy_requests_;
638 642
639 base::Closure did_scroll_callback_; 643 base::Closure did_scroll_callback_;
640 644
641 DrawProperties<Layer> draw_properties_; 645 DrawProperties<Layer> draw_properties_;
642 646
643 PaintProperties paint_properties_; 647 PaintProperties paint_properties_;
648 scoped_ptr<RenderSurface> render_surface_;
644 649
645 DISALLOW_COPY_AND_ASSIGN(Layer); 650 DISALLOW_COPY_AND_ASSIGN(Layer);
646 }; 651 };
647 652
648 } // namespace cc 653 } // namespace cc
649 654
650 #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