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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
318 texture_rect, draw_info.resource_size(), | 318 texture_rect, draw_info.resource_size(), |
319 draw_info.contents_swizzled(), nearest_neighbor_); | 319 draw_info.contents_swizzled(), nearest_neighbor_); |
320 ValidateQuadResources(quad); | 320 ValidateQuadResources(quad); |
321 iter->draw_info().set_was_ever_used_to_draw(); | 321 iter->draw_info().set_was_ever_used_to_draw(); |
322 has_draw_quad = true; | 322 has_draw_quad = true; |
323 break; | 323 break; |
324 } | 324 } |
325 case TileDrawInfo::SOLID_COLOR_MODE: { | 325 case TileDrawInfo::SOLID_COLOR_MODE: { |
326 SolidColorDrawQuad* quad = | 326 SolidColorDrawQuad* quad = |
327 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 327 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
328 quad->SetNew(shared_quad_state, geometry_rect, visible_geometry_rect, | 328 |
329 draw_info.solid_color(), false); | 329 // At the beginning of the for loop above, opaque_rect is defined |
330 // against contents_opaque(). If it was actually the case then use it | |
331 // otherwise use quad->SetNew which configure opaque_rect on other | |
332 // condition. | |
333 if (contents_opaque()) { | |
334 quad->SetAll(shared_quad_state, geometry_rect, opaque_rect, | |
335 visible_geometry_rect, false, draw_info.solid_color(), | |
336 false); | |
337 } else { | |
338 quad->SetNew(shared_quad_state, geometry_rect, | |
339 visible_geometry_rect, draw_info.solid_color(), false); | |
340 } | |
trchen
2016/03/08 01:57:21
Why is this change needed? This only changes the b
| |
330 ValidateQuadResources(quad); | 341 ValidateQuadResources(quad); |
331 iter->draw_info().set_was_ever_used_to_draw(); | 342 iter->draw_info().set_was_ever_used_to_draw(); |
332 has_draw_quad = true; | 343 has_draw_quad = true; |
333 break; | 344 break; |
334 } | 345 } |
335 case TileDrawInfo::OOM_MODE: | 346 case TileDrawInfo::OOM_MODE: |
336 break; // Checkerboard. | 347 break; // Checkerboard. |
337 } | 348 } |
338 } | 349 } |
339 | 350 |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1259 | 1270 |
1260 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1271 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1261 return !layer_tree_impl()->IsRecycleTree(); | 1272 return !layer_tree_impl()->IsRecycleTree(); |
1262 } | 1273 } |
1263 | 1274 |
1264 bool PictureLayerImpl::HasValidTilePriorities() const { | 1275 bool PictureLayerImpl::HasValidTilePriorities() const { |
1265 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1276 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
1266 } | 1277 } |
1267 | 1278 |
1268 } // namespace cc | 1279 } // namespace cc |
OLD | NEW |