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 | 8 |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, | 92 void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, |
93 AppendQuadsData* append_quads_data) { | 93 AppendQuadsData* append_quads_data) { |
94 gfx::Rect rect(visible_content_rect()); | 94 gfx::Rect rect(visible_content_rect()); |
95 gfx::Rect content_rect(content_bounds()); | 95 gfx::Rect content_rect(content_bounds()); |
96 | 96 |
97 SharedQuadState* shared_quad_state = | 97 SharedQuadState* shared_quad_state = |
98 quad_sink->UseSharedQuadState(CreateSharedQuadState()); | 98 quad_sink->UseSharedQuadState(CreateSharedQuadState()); |
99 AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); | 99 AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); |
100 | 100 |
| 101 if (append_quads_data->cannot_append_tile_draw_quads) { |
| 102 gfx::Rect geometry_rect = rect; |
| 103 gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect(); |
| 104 gfx::Size texture_size = rect.size(); |
| 105 gfx::RectF texture_rect = gfx::RectF(texture_size); |
| 106 gfx::Rect quad_content_rect = rect; |
| 107 float contents_scale = contents_scale_x(); |
| 108 |
| 109 scoped_ptr<PictureDrawQuad> quad = PictureDrawQuad::Create(); |
| 110 quad->SetNew(shared_quad_state, |
| 111 geometry_rect, |
| 112 opaque_rect, |
| 113 texture_rect, |
| 114 texture_size, |
| 115 false, |
| 116 quad_content_rect, |
| 117 contents_scale, |
| 118 pile_); |
| 119 if (quad_sink->Append(quad.PassAs<DrawQuad>(), append_quads_data)) |
| 120 append_quads_data->num_missing_tiles++; |
| 121 return; |
| 122 } |
| 123 |
101 bool clipped = false; | 124 bool clipped = false; |
102 gfx::QuadF target_quad = MathUtil::MapQuad( | 125 gfx::QuadF target_quad = MathUtil::MapQuad( |
103 draw_transform(), | 126 draw_transform(), |
104 gfx::QuadF(rect), | 127 gfx::QuadF(rect), |
105 &clipped); | 128 &clipped); |
106 if (ShowDebugBorders()) { | 129 if (ShowDebugBorders()) { |
107 for (PictureLayerTilingSet::CoverageIterator iter( | 130 for (PictureLayerTilingSet::CoverageIterator iter( |
108 tilings_.get(), contents_scale_x(), rect, ideal_contents_scale_); | 131 tilings_.get(), contents_scale_x(), rect, ideal_contents_scale_); |
109 iter; | 132 iter; |
110 ++iter) { | 133 ++iter) { |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { | 923 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { |
901 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 924 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
902 LayerImpl::AsValueInto(state.get()); | 925 LayerImpl::AsValueInto(state.get()); |
903 | 926 |
904 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); | 927 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); |
905 state->Set("tilings", tilings_->AsValue().release()); | 928 state->Set("tilings", tilings_->AsValue().release()); |
906 return state.PassAs<base::Value>(); | 929 return state.PassAs<base::Value>(); |
907 } | 930 } |
908 | 931 |
909 } // namespace cc | 932 } // namespace cc |
OLD | NEW |