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

Side by Side Diff: cc/trees/layer_tree_host_impl.h

Issue 131683005: cc: Make PrepareToDraw return an enum for why it aborts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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_TREES_LAYER_TREE_HOST_IMPL_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_
7 7
8 #include <list> 8 #include <list>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 12 matching lines...) Expand all
23 #include "cc/input/top_controls_manager_client.h" 23 #include "cc/input/top_controls_manager_client.h"
24 #include "cc/layers/layer_lists.h" 24 #include "cc/layers/layer_lists.h"
25 #include "cc/layers/render_pass_sink.h" 25 #include "cc/layers/render_pass_sink.h"
26 #include "cc/output/begin_frame_args.h" 26 #include "cc/output/begin_frame_args.h"
27 #include "cc/output/managed_memory_policy.h" 27 #include "cc/output/managed_memory_policy.h"
28 #include "cc/output/output_surface_client.h" 28 #include "cc/output/output_surface_client.h"
29 #include "cc/output/renderer.h" 29 #include "cc/output/renderer.h"
30 #include "cc/quads/render_pass.h" 30 #include "cc/quads/render_pass.h"
31 #include "cc/resources/resource_provider.h" 31 #include "cc/resources/resource_provider.h"
32 #include "cc/resources/tile_manager.h" 32 #include "cc/resources/tile_manager.h"
33 #include "cc/scheduler/draw_swap_readback_result.h"
33 #include "skia/ext/refptr.h" 34 #include "skia/ext/refptr.h"
34 #include "third_party/skia/include/core/SkColor.h" 35 #include "third_party/skia/include/core/SkColor.h"
35 #include "ui/gfx/rect.h" 36 #include "ui/gfx/rect.h"
36 37
37 namespace cc { 38 namespace cc {
38 39
39 class CompletionEvent; 40 class CompletionEvent;
40 class CompositorFrameMetadata; 41 class CompositorFrameMetadata;
41 class DebugRectHistory; 42 class DebugRectHistory;
42 class FrameRateCounter; 43 class FrameRateCounter;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 void UpdateBackgroundAnimateTicking(bool should_background_tick); 173 void UpdateBackgroundAnimateTicking(bool should_background_tick);
173 void DidAnimateScrollOffset(); 174 void DidAnimateScrollOffset();
174 void SetViewportDamage(const gfx::Rect& damage_rect); 175 void SetViewportDamage(const gfx::Rect& damage_rect);
175 176
176 virtual void ManageTiles(); 177 virtual void ManageTiles();
177 178
178 // Returns false if problems occured preparing the frame, and we should try 179 // Returns false if problems occured preparing the frame, and we should try
179 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers 180 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers
180 // must also be called, regardless of whether DrawLayers is called between the 181 // must also be called, regardless of whether DrawLayers is called between the
181 // two. 182 // two.
182 virtual bool PrepareToDraw(FrameData* frame, 183 virtual DrawSwapReadbackResult::DrawResult PrepareToDraw(
183 const gfx::Rect& damage_rect); 184 FrameData* frame,
185 const gfx::Rect& damage_rect);
184 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); 186 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time);
185 // Must be called if and only if PrepareToDraw was called. 187 // Must be called if and only if PrepareToDraw was called.
186 void DidDrawAllLayers(const FrameData& frame); 188 void DidDrawAllLayers(const FrameData& frame);
187 189
188 const LayerTreeSettings& settings() const { return settings_; } 190 const LayerTreeSettings& settings() const { return settings_; }
189 191
190 // Evict all textures by enforcing a memory policy with an allocation of 0. 192 // Evict all textures by enforcing a memory policy with an allocation of 0.
191 void EvictTexturesForTesting(); 193 void EvictTexturesForTesting();
192 194
193 // When blocking, this prevents client_->NotifyReadyToActivate() from being 195 // When blocking, this prevents client_->NotifyReadyToActivate() from being
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 const gfx::PointF& viewport_point, 476 const gfx::PointF& viewport_point,
475 const gfx::Vector2dF& viewport_delta); 477 const gfx::Vector2dF& viewport_delta);
476 478
477 void UpdateMaxScrollOffset(); 479 void UpdateMaxScrollOffset();
478 void TrackDamageForAllSurfaces( 480 void TrackDamageForAllSurfaces(
479 LayerImpl* root_draw_layer, 481 LayerImpl* root_draw_layer,
480 const LayerImplList& render_surface_layer_list); 482 const LayerImplList& render_surface_layer_list);
481 483
482 void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy); 484 void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy);
483 485
484 // Returns false if the frame should not be displayed. This function should 486 // This function should only be called from PrepareToDraw, as DidDrawAllLayers
485 // only be called from PrepareToDraw, as DidDrawAllLayers must be called 487 // must be called if this helper function is called. Returns DID_DRAW if
486 // if this helper function is called. 488 // the frame should be drawn.
487 bool CalculateRenderPasses(FrameData* frame); 489 DrawSwapReadbackResult::DrawResult CalculateRenderPasses(FrameData* frame);
488 490
489 void SendReleaseResourcesRecursive(LayerImpl* current); 491 void SendReleaseResourcesRecursive(LayerImpl* current);
490 bool EnsureRenderSurfaceLayerList(); 492 bool EnsureRenderSurfaceLayerList();
491 void ClearCurrentlyScrollingLayer(); 493 void ClearCurrentlyScrollingLayer();
492 494
493 bool HandleMouseOverScrollbar(LayerImpl* layer_impl, 495 bool HandleMouseOverScrollbar(LayerImpl* layer_impl,
494 const gfx::PointF& device_viewport_point); 496 const gfx::PointF& device_viewport_point);
495 497
496 void AnimateScrollbarsRecursive(LayerImpl* layer, 498 void AnimateScrollbarsRecursive(LayerImpl* layer,
497 base::TimeTicks time); 499 base::TimeTicks time);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 int id_; 654 int id_;
653 655
654 std::set<SwapPromiseMonitor*> swap_promise_monitor_; 656 std::set<SwapPromiseMonitor*> swap_promise_monitor_;
655 657
656 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 658 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
657 }; 659 };
658 660
659 } // namespace cc 661 } // namespace cc
660 662
661 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 663 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698