| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |