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

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 1326733003: cc: Workaround resourceless draw crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2454
Patch Set: Created 5 years, 3 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <set> 10 #include <set>
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (current_draw_mode_ == DRAW_MODE_RESOURCELESS_SOFTWARE) { 176 if (current_draw_mode_ == DRAW_MODE_RESOURCELESS_SOFTWARE) {
177 AppendDebugBorderQuad( 177 AppendDebugBorderQuad(
178 render_pass, shared_quad_state->quad_layer_bounds, shared_quad_state, 178 render_pass, shared_quad_state->quad_layer_bounds, shared_quad_state,
179 append_quads_data, DebugColors::DirectPictureBorderColor(), 179 append_quads_data, DebugColors::DirectPictureBorderColor(),
180 DebugColors::DirectPictureBorderWidth(layer_tree_impl())); 180 DebugColors::DirectPictureBorderWidth(layer_tree_impl()));
181 181
182 gfx::Rect geometry_rect = shared_quad_state->visible_quad_layer_rect; 182 gfx::Rect geometry_rect = shared_quad_state->visible_quad_layer_rect;
183 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect(); 183 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect();
184 gfx::Rect visible_geometry_rect = 184 gfx::Rect visible_geometry_rect =
185 scaled_occlusion.GetUnoccludedContentRect(geometry_rect); 185 scaled_occlusion.GetUnoccludedContentRect(geometry_rect);
186 if (visible_geometry_rect.IsEmpty()) 186 // TODO(enne): HasRecordings is a workaround for crash in crbug.com/526402.
187 // Need proper fix for when recording does not cover visible rect.
188 if (visible_geometry_rect.IsEmpty() || !raster_source_->HasRecordings())
187 return; 189 return;
188 190
189 gfx::Rect quad_content_rect = shared_quad_state->visible_quad_layer_rect; 191 gfx::Rect quad_content_rect = shared_quad_state->visible_quad_layer_rect;
190 gfx::Size texture_size = quad_content_rect.size(); 192 gfx::Size texture_size = quad_content_rect.size();
191 gfx::RectF texture_rect = gfx::RectF(texture_size); 193 gfx::RectF texture_rect = gfx::RectF(texture_size);
192 194
193 PictureDrawQuad* quad = 195 PictureDrawQuad* quad =
194 render_pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); 196 render_pass->CreateAndAppendDrawQuad<PictureDrawQuad>();
195 quad->SetNew(shared_quad_state, geometry_rect, opaque_rect, 197 quad->SetNew(shared_quad_state, geometry_rect, opaque_rect,
196 visible_geometry_rect, texture_rect, texture_size, 198 visible_geometry_rect, texture_rect, texture_size,
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 1219
1218 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1220 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1219 return !layer_tree_impl()->IsRecycleTree(); 1221 return !layer_tree_impl()->IsRecycleTree();
1220 } 1222 }
1221 1223
1222 bool PictureLayerImpl::HasValidTilePriorities() const { 1224 bool PictureLayerImpl::HasValidTilePriorities() const {
1223 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); 1225 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember();
1224 } 1226 }
1225 1227
1226 } // namespace cc 1228 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698