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

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

Issue 1326713002: cc: Workaround resourceless draw crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add todo 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 if (current_draw_mode_ == DRAW_MODE_RESOURCELESS_SOFTWARE) { 175 if (current_draw_mode_ == DRAW_MODE_RESOURCELESS_SOFTWARE) {
176 AppendDebugBorderQuad( 176 AppendDebugBorderQuad(
177 render_pass, shared_quad_state->quad_layer_bounds, shared_quad_state, 177 render_pass, shared_quad_state->quad_layer_bounds, shared_quad_state,
178 append_quads_data, DebugColors::DirectPictureBorderColor(), 178 append_quads_data, DebugColors::DirectPictureBorderColor(),
179 DebugColors::DirectPictureBorderWidth(layer_tree_impl())); 179 DebugColors::DirectPictureBorderWidth(layer_tree_impl()));
180 180
181 gfx::Rect geometry_rect = shared_quad_state->visible_quad_layer_rect; 181 gfx::Rect geometry_rect = shared_quad_state->visible_quad_layer_rect;
182 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect(); 182 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect();
183 gfx::Rect visible_geometry_rect = 183 gfx::Rect visible_geometry_rect =
184 scaled_occlusion.GetUnoccludedContentRect(geometry_rect); 184 scaled_occlusion.GetUnoccludedContentRect(geometry_rect);
185 if (visible_geometry_rect.IsEmpty()) 185 // TODO(enne): HasRecordings is a workaround for crash in crbug.com/526402.
186 // Need proper fix for when recording does not cover visible rect.
187 if (visible_geometry_rect.IsEmpty() || !raster_source_->HasRecordings())
186 return; 188 return;
187 189
188 gfx::Rect quad_content_rect = shared_quad_state->visible_quad_layer_rect; 190 gfx::Rect quad_content_rect = shared_quad_state->visible_quad_layer_rect;
189 gfx::Size texture_size = quad_content_rect.size(); 191 gfx::Size texture_size = quad_content_rect.size();
190 gfx::RectF texture_rect = gfx::RectF(texture_size); 192 gfx::RectF texture_rect = gfx::RectF(texture_size);
191 193
192 PictureDrawQuad* quad = 194 PictureDrawQuad* quad =
193 render_pass->CreateAndAppendDrawQuad<PictureDrawQuad>(); 195 render_pass->CreateAndAppendDrawQuad<PictureDrawQuad>();
194 quad->SetNew(shared_quad_state, geometry_rect, opaque_rect, 196 quad->SetNew(shared_quad_state, geometry_rect, opaque_rect,
195 visible_geometry_rect, texture_rect, texture_size, 197 visible_geometry_rect, texture_rect, texture_size,
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 1238
1237 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1239 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1238 return !layer_tree_impl()->IsRecycleTree(); 1240 return !layer_tree_impl()->IsRecycleTree();
1239 } 1241 }
1240 1242
1241 bool PictureLayerImpl::HasValidTilePriorities() const { 1243 bool PictureLayerImpl::HasValidTilePriorities() const {
1242 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); 1244 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember();
1243 } 1245 }
1244 1246
1245 } // namespace cc 1247 } // 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