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

Unified Diff: cc/layers/surface_layer_impl.cc

Issue 2861593002: cc: Only add surface ID to embedded_surfaces if fallback does not match (Closed)
Patch Set: Added a comment Created 3 years, 7 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/surface_layer_impl.h ('k') | cc/layers/surface_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/surface_layer_impl.cc
diff --git a/cc/layers/surface_layer_impl.cc b/cc/layers/surface_layer_impl.cc
index 92e1371e2d9ce8cd4f873ea29d27649716ada6bd..691a495f982c2d0413900b1de39fa884ad8c053e 100644
--- a/cc/layers/surface_layer_impl.cc
+++ b/cc/layers/surface_layer_impl.cc
@@ -66,12 +66,16 @@ void SurfaceLayerImpl::AppendQuads(RenderPass* render_pass,
AppendQuadsData* append_quads_data) {
AppendRainbowDebugBorder(render_pass);
SharedQuadState* common_shared_quad_state = nullptr;
- auto* primary = CreateSurfaceDrawQuad(
- render_pass, SurfaceDrawQuadType::PRIMARY, primary_surface_info_,
- &append_quads_data->embedded_surfaces, &common_shared_quad_state);
+ auto* primary =
+ CreateSurfaceDrawQuad(render_pass, SurfaceDrawQuadType::PRIMARY,
+ primary_surface_info_, &common_shared_quad_state);
// Emitting a fallback SurfaceDrawQuad is unnecessary if the primary and
// fallback surface Ids match.
- if (primary && fallback_surface_info_.id() != primary_surface_info_.id()) {
+ bool needs_fallback =
+ fallback_surface_info_.id() != primary_surface_info_.id();
+ if (primary && needs_fallback) {
+ // Add the primary surface ID as a dependency.
+ append_quads_data->embedded_surfaces.push_back(primary_surface_info_.id());
// We can use the same SharedQuadState as the primary SurfaceDrawQuad if
// we don't need a different transform on the fallback.
bool use_common_shared_quad_state =
@@ -80,7 +84,6 @@ void SurfaceLayerImpl::AppendQuads(RenderPass* render_pass,
fallback_surface_info_.device_scale_factor();
primary->fallback_quad = CreateSurfaceDrawQuad(
render_pass, SurfaceDrawQuadType::FALLBACK, fallback_surface_info_,
- nullptr /* embedded_surfaces */,
use_common_shared_quad_state ? &common_shared_quad_state : nullptr);
}
}
@@ -89,7 +92,6 @@ SurfaceDrawQuad* SurfaceLayerImpl::CreateSurfaceDrawQuad(
RenderPass* render_pass,
SurfaceDrawQuadType surface_draw_quad_type,
const SurfaceInfo& surface_info,
- std::vector<SurfaceId>* embedded_surfaces,
SharedQuadState** common_shared_quad_state) {
if (!surface_info.is_valid())
return nullptr;
@@ -139,8 +141,6 @@ SurfaceDrawQuad* SurfaceLayerImpl::CreateSurfaceDrawQuad(
render_pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
surface_draw_quad->SetNew(shared_quad_state, quad_rect, visible_quad_rect,
surface_info.id(), surface_draw_quad_type, nullptr);
- if (embedded_surfaces)
- embedded_surfaces->push_back(surface_info.id());
return surface_draw_quad;
}
« no previous file with comments | « cc/layers/surface_layer_impl.h ('k') | cc/layers/surface_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698