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

Side by Side 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: Updated 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/layers/surface_layer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "cc/layers/surface_layer_impl.h" 5 #include "cc/layers/surface_layer_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/trace_event/trace_event_argument.h" 9 #include "base/trace_event/trace_event_argument.h"
10 #include "cc/debug/debug_colors.h" 10 #include "cc/debug/debug_colors.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 LayerImpl::PushPropertiesTo(layer); 58 LayerImpl::PushPropertiesTo(layer);
59 SurfaceLayerImpl* layer_impl = static_cast<SurfaceLayerImpl*>(layer); 59 SurfaceLayerImpl* layer_impl = static_cast<SurfaceLayerImpl*>(layer);
60 layer_impl->SetPrimarySurfaceInfo(primary_surface_info_); 60 layer_impl->SetPrimarySurfaceInfo(primary_surface_info_);
61 layer_impl->SetFallbackSurfaceInfo(fallback_surface_info_); 61 layer_impl->SetFallbackSurfaceInfo(fallback_surface_info_);
62 layer_impl->SetStretchContentToFillBounds(stretch_content_to_fill_bounds_); 62 layer_impl->SetStretchContentToFillBounds(stretch_content_to_fill_bounds_);
63 } 63 }
64 64
65 void SurfaceLayerImpl::AppendQuads(RenderPass* render_pass, 65 void SurfaceLayerImpl::AppendQuads(RenderPass* render_pass,
66 AppendQuadsData* append_quads_data) { 66 AppendQuadsData* append_quads_data) {
67 AppendRainbowDebugBorder(render_pass); 67 AppendRainbowDebugBorder(render_pass);
68 bool needs_synchronization =
danakj 2017/05/04 19:14:08 nit: needs_fallback?
Fady Samuel 2017/05/04 20:03:48 Done.
69 fallback_surface_info_.id() != primary_surface_info_.id();
68 auto* primary = CreateSurfaceDrawQuad( 70 auto* primary = CreateSurfaceDrawQuad(
69 render_pass, SurfaceDrawQuadType::PRIMARY, primary_surface_info_, 71 render_pass, SurfaceDrawQuadType::PRIMARY, primary_surface_info_,
70 &append_quads_data->embedded_surfaces); 72 needs_synchronization ? &append_quads_data->embedded_surfaces : nullptr);
danakj 2017/05/04 19:14:08 The side effects here are very unclear, with the r
Fady Samuel 2017/05/04 20:03:48 Done.
71 // Emitting a fallback SurfaceDrawQuad is unnecessary if the primary and 73 // Emitting a fallback SurfaceDrawQuad is unnecessary if the primary and
72 // fallback surface Ids match. 74 // fallback surface Ids match.
73 if (primary && fallback_surface_info_.id() != primary_surface_info_.id()) { 75 if (primary && needs_synchronization) {
74 primary->fallback_quad = CreateSurfaceDrawQuad( 76 primary->fallback_quad = CreateSurfaceDrawQuad(
75 render_pass, SurfaceDrawQuadType::FALLBACK, fallback_surface_info_, 77 render_pass, SurfaceDrawQuadType::FALLBACK, fallback_surface_info_,
76 nullptr /* embedded_surfaces */); 78 nullptr /* embedded_surfaces */);
77 } 79 }
78 } 80 }
79 81
80 SurfaceDrawQuad* SurfaceLayerImpl::CreateSurfaceDrawQuad( 82 SurfaceDrawQuad* SurfaceLayerImpl::CreateSurfaceDrawQuad(
81 RenderPass* render_pass, 83 RenderPass* render_pass,
82 SurfaceDrawQuadType surface_draw_quad_type, 84 SurfaceDrawQuadType surface_draw_quad_type,
83 const SurfaceInfo& surface_info, 85 const SurfaceInfo& surface_info,
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 dict->SetString("surface_id", primary_surface_info_.id().ToString()); 228 dict->SetString("surface_id", primary_surface_info_.id().ToString());
227 dict->SetString("fallback_surface_id", 229 dict->SetString("fallback_surface_id",
228 fallback_surface_info_.id().ToString()); 230 fallback_surface_info_.id().ToString());
229 } 231 }
230 232
231 const char* SurfaceLayerImpl::LayerTypeAsString() const { 233 const char* SurfaceLayerImpl::LayerTypeAsString() const {
232 return "cc::SurfaceLayerImpl"; 234 return "cc::SurfaceLayerImpl";
233 } 235 }
234 236
235 } // namespace cc 237 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/surface_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698