| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |