summaryrefslogtreecommitdiffstats
path: root/cc/surfaces/surface_aggregator.h
diff options
context:
space:
mode:
authorjbauman <jbauman@chromium.org>2015-07-13 18:55:23 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-14 01:56:02 +0000
commit826aae36bc7da8a39f9b5eebefe9e51c59a63cfd (patch)
treea9f011ee9c234f0cdf388bd82a0cb53e1b9ee41c /cc/surfaces/surface_aggregator.h
parentcd0ea9c552e554f44d66638937b4b8e001e96974 (diff)
downloadchromium_src-826aae36bc7da8a39f9b5eebefe9e51c59a63cfd.zip
chromium_src-826aae36bc7da8a39f9b5eebefe9e51c59a63cfd.tar.gz
chromium_src-826aae36bc7da8a39f9b5eebefe9e51c59a63cfd.tar.bz2
Don't aggregate quads outside of damage rect when using partial swap.
The quads will be scissored out, so aggregating them is a waste. For me on a webpage with a tiny spinner this reduces DisplayScheduler::OnBeginFrameDeadline time by around 30%, and reduces the GPU process CPU time by around 50%. BUG=490447 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1172883004 Cr-Commit-Position: refs/heads/master@{#338619}
Diffstat (limited to 'cc/surfaces/surface_aggregator.h')
-rw-r--r--cc/surfaces/surface_aggregator.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/cc/surfaces/surface_aggregator.h b/cc/surfaces/surface_aggregator.h
index 17ea4c4..1ff4a45 100644
--- a/cc/surfaces/surface_aggregator.h
+++ b/cc/surfaces/surface_aggregator.h
@@ -29,7 +29,9 @@ class CC_SURFACES_EXPORT SurfaceAggregator {
public:
typedef base::hash_map<SurfaceId, int> SurfaceIndexMap;
- SurfaceAggregator(SurfaceManager* manager, ResourceProvider* provider);
+ SurfaceAggregator(SurfaceManager* manager,
+ ResourceProvider* provider,
+ bool aggregate_only_damaged);
~SurfaceAggregator();
scoped_ptr<CompositorFrame> Aggregate(SurfaceId surface_id);
@@ -60,10 +62,10 @@ class CC_SURFACES_EXPORT SurfaceAggregator {
const gfx::Transform& target_transform,
const ClipData& clip_rect,
RenderPass* dest_pass);
- void CopySharedQuadState(const SharedQuadState* source_sqs,
- const gfx::Transform& target_transform,
- const ClipData& clip_rect,
- RenderPass* dest_render_pass);
+ SharedQuadState* CopySharedQuadState(const SharedQuadState* source_sqs,
+ const gfx::Transform& target_transform,
+ const ClipData& clip_rect,
+ RenderPass* dest_render_pass);
void CopyQuadsToPass(
const QuadList& source_quad_list,
const SharedQuadStateList& source_shared_quad_state_list,
@@ -72,7 +74,7 @@ class CC_SURFACES_EXPORT SurfaceAggregator {
const ClipData& clip_rect,
RenderPass* dest_pass,
SurfaceId surface_id);
- gfx::Rect ValidateAndCalculateDamageRect(SurfaceId surface_id);
+ gfx::Rect PrewalkTree(SurfaceId surface_id);
void CopyPasses(const DelegatedFrameData* frame_data, Surface* surface);
// Remove Surfaces that were referenced before but aren't currently
@@ -92,6 +94,7 @@ class CC_SURFACES_EXPORT SurfaceAggregator {
RenderPassIdAllocatorMap;
RenderPassIdAllocatorMap render_pass_allocator_map_;
int next_render_pass_id_;
+ const bool aggregate_only_damaged_;
typedef base::hash_map<SurfaceId, int> SurfaceToResourceChildIdMap;
SurfaceToResourceChildIdMap surface_id_to_resource_child_id_;
@@ -116,6 +119,13 @@ class CC_SURFACES_EXPORT SurfaceAggregator {
// This is the pass list for the aggregated frame.
RenderPassList* dest_pass_list_;
+ // The root damage rect of the currently-aggregating frame.
+ gfx::Rect root_damage_rect_;
+
+ // True if the frame that's currently being aggregated has copy requests.
+ // This is valid during Aggregate after PrewalkTree is called.
+ bool has_copy_requests_;
+
// Resource list for the aggregated frame.
TransferableResourceArray* dest_resource_list_;