Chromium Code Reviews| 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/solid_color_layer_impl.h" | 5 #include "cc/layers/solid_color_layer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
| 10 #include "cc/quads/solid_color_draw_quad.h" | 10 #include "cc/quads/solid_color_draw_quad.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 SkColor color, | 35 SkColor color, |
| 36 AppendQuadsData* append_quads_data) { | 36 AppendQuadsData* append_quads_data) { |
| 37 // We create a series of smaller quads instead of just one large one so that | 37 // We create a series of smaller quads instead of just one large one so that |
| 38 // the culler can reduce the total pixels drawn. | 38 // the culler can reduce the total pixels drawn. |
| 39 int width = visible_content_rect.width(); | 39 int width = visible_content_rect.width(); |
| 40 int height = visible_content_rect.height(); | 40 int height = visible_content_rect.height(); |
| 41 for (int x = visible_content_rect.x(); x < visible_content_rect.right(); | 41 for (int x = visible_content_rect.x(); x < visible_content_rect.right(); |
| 42 x += kSolidQuadTileSize) { | 42 x += kSolidQuadTileSize) { |
| 43 for (int y = visible_content_rect.y(); y < visible_content_rect.bottom(); | 43 for (int y = visible_content_rect.y(); y < visible_content_rect.bottom(); |
| 44 y += kSolidQuadTileSize) { | 44 y += kSolidQuadTileSize) { |
| 45 gfx::Rect quad_rect(x, | 45 gfx::Rect quad_rect( |
| 46 y, | 46 x, |
| 47 std::min(width - x, kSolidQuadTileSize), | 47 y, |
| 48 std::min(height - y, kSolidQuadTileSize)); | 48 std::min(visible_content_rect.right() - x, kSolidQuadTileSize), |
|
danakj
2014/10/27 22:53:07
throw these in temp vars like width/height so we d
| |
| 49 std::min(visible_content_rect.bottom() - y, kSolidQuadTileSize)); | |
| 49 gfx::Rect visible_quad_rect = | 50 gfx::Rect visible_quad_rect = |
| 50 occlusion_in_content_space.GetUnoccludedContentRect(quad_rect); | 51 occlusion_in_content_space.GetUnoccludedContentRect(quad_rect); |
| 51 if (visible_quad_rect.IsEmpty()) | 52 if (visible_quad_rect.IsEmpty()) |
| 52 continue; | 53 continue; |
| 53 | 54 |
| 54 append_quads_data->visible_content_area += | 55 append_quads_data->visible_content_area += |
| 55 visible_quad_rect.width() * visible_quad_rect.height(); | 56 visible_quad_rect.width() * visible_quad_rect.height(); |
| 56 | 57 |
| 57 SolidColorDrawQuad* quad = | 58 SolidColorDrawQuad* quad = |
| 58 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 59 render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 81 gfx::Rect(content_bounds()), | 82 gfx::Rect(content_bounds()), |
| 82 background_color(), | 83 background_color(), |
| 83 append_quads_data); | 84 append_quads_data); |
| 84 } | 85 } |
| 85 | 86 |
| 86 const char* SolidColorLayerImpl::LayerTypeAsString() const { | 87 const char* SolidColorLayerImpl::LayerTypeAsString() const { |
| 87 return "cc::SolidColorLayerImpl"; | 88 return "cc::SolidColorLayerImpl"; |
| 88 } | 89 } |
| 89 | 90 |
| 90 } // namespace cc | 91 } // namespace cc |
| OLD | NEW |