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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // the best the layer can promise in the future, consider those as | 287 // the best the layer can promise in the future, consider those as |
288 // complete. But if a tile is ideal scale, we don't want to consider | 288 // complete. But if a tile is ideal scale, we don't want to consider |
289 // it incomplete and trying to replace it with a tile at a worse | 289 // it incomplete and trying to replace it with a tile at a worse |
290 // scale. | 290 // scale. |
291 if (iter->contents_scale() != raster_contents_scale_ && | 291 if (iter->contents_scale() != raster_contents_scale_ && |
292 iter->contents_scale() != ideal_contents_scale_ && | 292 iter->contents_scale() != ideal_contents_scale_ && |
293 geometry_rect.Intersects(scaled_viewport_for_tile_priority)) { | 293 geometry_rect.Intersects(scaled_viewport_for_tile_priority)) { |
294 append_quads_data->num_incomplete_tiles++; | 294 append_quads_data->num_incomplete_tiles++; |
295 } | 295 } |
296 | 296 |
| 297 // Only swizzle contents for software rasterization, where texture |
| 298 // uploads require it. |
| 299 bool swizzle_contents = !layer_tree_impl()->use_gpu_rasterization() && |
| 300 draw_info.contents_swizzled(); |
297 TileDrawQuad* quad = | 301 TileDrawQuad* quad = |
298 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); | 302 render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); |
299 quad->SetNew(shared_quad_state, geometry_rect, opaque_rect, | 303 quad->SetNew(shared_quad_state, geometry_rect, opaque_rect, |
300 visible_geometry_rect, draw_info.resource_id(), | 304 visible_geometry_rect, draw_info.resource_id(), |
301 texture_rect, draw_info.resource_size(), | 305 texture_rect, draw_info.resource_size(), |
302 draw_info.contents_swizzled(), nearest_neighbor_); | 306 swizzle_contents, nearest_neighbor_); |
303 ValidateQuadResources(quad); | 307 ValidateQuadResources(quad); |
304 has_draw_quad = true; | 308 has_draw_quad = true; |
305 break; | 309 break; |
306 } | 310 } |
307 case TileDrawInfo::SOLID_COLOR_MODE: { | 311 case TileDrawInfo::SOLID_COLOR_MODE: { |
308 SolidColorDrawQuad* quad = | 312 SolidColorDrawQuad* quad = |
309 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 313 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
310 quad->SetNew(shared_quad_state, geometry_rect, visible_geometry_rect, | 314 quad->SetNew(shared_quad_state, geometry_rect, visible_geometry_rect, |
311 draw_info.solid_color(), false); | 315 draw_info.solid_color(), false); |
312 ValidateQuadResources(quad); | 316 ValidateQuadResources(quad); |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 | 1231 |
1228 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1232 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1229 return !layer_tree_impl()->IsRecycleTree(); | 1233 return !layer_tree_impl()->IsRecycleTree(); |
1230 } | 1234 } |
1231 | 1235 |
1232 bool PictureLayerImpl::HasValidTilePriorities() const { | 1236 bool PictureLayerImpl::HasValidTilePriorities() const { |
1233 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1237 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
1234 } | 1238 } |
1235 | 1239 |
1236 } // namespace cc | 1240 } // namespace cc |
OLD | NEW |