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

Unified Diff: cc/layers/render_surface_impl.cc

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Rebased to resolve conflict. Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/render_surface_impl.h ('k') | cc/output/direct_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/render_surface_impl.cc
diff --git a/cc/layers/render_surface_impl.cc b/cc/layers/render_surface_impl.cc
index c4bc6e5468f6db741ed85057ac79324984a4a0b7..27bcfdfc396af181bd4d95f1dd7529e7d2fd4645 100644
--- a/cc/layers/render_surface_impl.cc
+++ b/cc/layers/render_surface_impl.cc
@@ -152,6 +152,10 @@ bool RenderSurfaceImpl::HasCopyRequest() const {
return OwningEffectNode()->has_copy_request;
}
+bool RenderSurfaceImpl::ShouldCacheRenderSurface() const {
+ return OwningEffectNode()->cache_render_surface;
+}
+
int RenderSurfaceImpl::TransformTreeIndex() const {
return OwningEffectNode()->transform_id;
}
@@ -201,7 +205,7 @@ gfx::Rect RenderSurfaceImpl::CalculateExpandedClipForFilters(
}
gfx::Rect RenderSurfaceImpl::CalculateClippedAccumulatedContentRect() {
- if (HasCopyRequest() || !is_clipped())
+ if (ShouldCacheRenderSurface() || HasCopyRequest() || !is_clipped())
return accumulated_content_rect();
if (accumulated_content_rect().IsEmpty())
@@ -336,6 +340,10 @@ void RenderSurfaceImpl::NoteAncestorPropertyChanged() {
ancestor_property_changed_ = true;
}
+bool RenderSurfaceImpl::HasDamageFromeContributingContent() const {
+ return damage_tracker_->has_damage_from_contributing_content();
+}
+
gfx::Rect RenderSurfaceImpl::GetDamageRect() const {
gfx::Rect damage_rect;
bool is_valid_rect = damage_tracker_->GetDamageRectIfValid(&damage_rect);
@@ -357,6 +365,9 @@ std::unique_ptr<RenderPass> RenderSurfaceImpl::CreateRenderPass() {
draw_properties_.screen_space_transform);
pass->filters = Filters();
pass->background_filters = BackgroundFilters();
+ pass->cache_render_pass = ShouldCacheRenderSurface();
+ pass->has_damage_from_contributing_content =
+ HasDamageFromeContributingContent();
return pass;
}
« no previous file with comments | « cc/layers/render_surface_impl.h ('k') | cc/output/direct_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698