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/picture_layer_impl.h" | 5 #include "cc/picture_layer_impl.h" |
6 | 6 |
7 #include "base/time.h" | 7 #include "base/time.h" |
8 #include "cc/append_quads_data.h" | 8 #include "cc/append_quads_data.h" |
9 #include "cc/checkerboard_draw_quad.h" | 9 #include "cc/checkerboard_draw_quad.h" |
10 #include "cc/debug_border_draw_quad.h" | 10 #include "cc/debug_border_draw_quad.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 void PictureLayerImpl::appendQuads(QuadSink& quadSink, | 43 void PictureLayerImpl::appendQuads(QuadSink& quadSink, |
44 AppendQuadsData& appendQuadsData) { | 44 AppendQuadsData& appendQuadsData) { |
45 | 45 |
46 const gfx::Rect& rect = visibleContentRect(); | 46 const gfx::Rect& rect = visibleContentRect(); |
47 gfx::Rect content_rect(gfx::Point(), contentBounds()); | 47 gfx::Rect content_rect(gfx::Point(), contentBounds()); |
48 | 48 |
49 SharedQuadState* sharedQuadState = | 49 SharedQuadState* sharedQuadState = |
50 quadSink.useSharedQuadState(createSharedQuadState()); | 50 quadSink.useSharedQuadState(createSharedQuadState()); |
51 bool clipped = false; | |
52 gfx::QuadF target_quad = MathUtil::mapQuad( | |
53 drawTransform(), | |
54 gfx::QuadF(rect), | |
55 clipped); | |
56 bool isAxisAlignedInTarget = !clipped && target_quad.IsRectilinear(); | |
57 bool useAA = !isAxisAlignedInTarget; | |
58 | 51 |
59 if (showDebugBorders()) { | 52 if (showDebugBorders()) { |
60 for (PictureLayerTilingSet::Iterator iter(&tilings_, | 53 for (PictureLayerTilingSet::Iterator iter(&tilings_, |
61 contentsScaleX(), | 54 contentsScaleX(), |
62 rect, | 55 rect, |
63 ideal_contents_scale_); | 56 ideal_contents_scale_); |
64 iter; | 57 iter; |
65 ++iter) { | 58 ++iter) { |
66 SkColor color; | 59 SkColor color; |
67 float width; | 60 float width; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 bool outside_bottom_edge = geometry_rect.bottom() == content_rect.bottom(); | 117 bool outside_bottom_edge = geometry_rect.bottom() == content_rect.bottom(); |
125 | 118 |
126 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); | 119 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); |
127 quad->SetNew(sharedQuadState, | 120 quad->SetNew(sharedQuadState, |
128 geometry_rect, | 121 geometry_rect, |
129 opaque_rect, | 122 opaque_rect, |
130 resource, | 123 resource, |
131 texture_rect, | 124 texture_rect, |
132 iter.texture_size(), | 125 iter.texture_size(), |
133 iter->contents_swizzled(), | 126 iter->contents_swizzled(), |
134 outside_left_edge && useAA, | 127 outside_left_edge, |
135 outside_top_edge && useAA, | 128 outside_top_edge, |
136 outside_right_edge && useAA, | 129 outside_right_edge, |
137 outside_bottom_edge && useAA); | 130 outside_bottom_edge); |
138 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); | 131 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); |
139 | 132 |
140 if (!seen_tilings.size() || seen_tilings.back() != iter.CurrentTiling()) | 133 if (!seen_tilings.size() || seen_tilings.back() != iter.CurrentTiling()) |
141 seen_tilings.push_back(iter.CurrentTiling()); | 134 seen_tilings.push_back(iter.CurrentTiling()); |
142 } | 135 } |
143 | 136 |
144 // During a pinch, a user could zoom in and out, so throwing away a tiling may | 137 // During a pinch, a user could zoom in and out, so throwing away a tiling may |
145 // be premature. | 138 // be premature. |
146 if (!layerTreeImpl()->PinchGestureActive()) | 139 if (!layerTreeImpl()->PinchGestureActive()) |
147 CleanUpUnusedTilings(seen_tilings); | 140 CleanUpUnusedTilings(seen_tilings); |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 if (std::find(used_tilings.begin(), used_tilings.end(), tiling) == | 406 if (std::find(used_tilings.begin(), used_tilings.end(), tiling) == |
414 used_tilings.end()) | 407 used_tilings.end()) |
415 to_remove.push_back(tiling); | 408 to_remove.push_back(tiling); |
416 } | 409 } |
417 | 410 |
418 for (size_t i = 0; i < to_remove.size(); ++i) | 411 for (size_t i = 0; i < to_remove.size(); ++i) |
419 tilings_.Remove(to_remove[i]); | 412 tilings_.Remove(to_remove[i]); |
420 } | 413 } |
421 | 414 |
422 } // namespace cc | 415 } // namespace cc |
OLD | NEW |