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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 for (PictureLayerTilingSet::Iterator iter(&tilings_, contentsScaleX(), rect); | 75 for (PictureLayerTilingSet::Iterator iter(&tilings_, contentsScaleX(), rect); |
76 iter; | 76 iter; |
77 ++iter) { | 77 ++iter) { |
78 ResourceProvider::ResourceId resource = 0; | 78 ResourceProvider::ResourceId resource = 0; |
79 if (*iter) | 79 if (*iter) |
80 resource = iter->GetResourceId(); | 80 resource = iter->GetResourceId(); |
81 | 81 |
82 gfx::Rect geometry_rect = iter.geometry_rect(); | 82 gfx::Rect geometry_rect = iter.geometry_rect(); |
83 | 83 |
| 84 bool outside_left_edge = geometry_rect.x() == content_rect.x(); |
| 85 bool outside_top_edge = geometry_rect.y() == content_rect.y(); |
| 86 bool outside_right_edge = geometry_rect.right() == content_rect.right(); |
| 87 bool outside_bottom_edge = geometry_rect.bottom() == content_rect.bottom(); |
| 88 |
84 if (!resource) { | 89 if (!resource) { |
85 if (drawCheckerboardForMissingTiles()) { | 90 if (drawCheckerboardForMissingTiles()) { |
86 // TODO(enne): Figure out how to show debug "invalidated checker" color | 91 // TODO(enne): Figure out how to show debug "invalidated checker" color |
87 scoped_ptr<CheckerboardDrawQuad> quad = CheckerboardDrawQuad::Create(); | 92 scoped_ptr<CheckerboardDrawQuad> quad = CheckerboardDrawQuad::Create(); |
88 SkColor color = DebugColors::DefaultCheckerboardColor(); | 93 SkColor color = DebugColors::DefaultCheckerboardColor(); |
89 quad->SetNew(sharedQuadState, geometry_rect, color); | 94 quad->SetNew(sharedQuadState, geometry_rect, color); |
90 if (quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData)) | 95 if (quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData)) |
91 appendQuadsData.numMissingTiles++; | 96 appendQuadsData.numMissingTiles++; |
92 } else { | 97 } else { |
93 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); | 98 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); |
94 quad->SetNew(sharedQuadState, geometry_rect, backgroundColor()); | 99 quad->SetNew(sharedQuadState, geometry_rect, backgroundColor(), |
| 100 outside_left_edge && useAA, |
| 101 outside_top_edge && useAA, |
| 102 outside_right_edge && useAA, |
| 103 outside_bottom_edge && useAA); |
95 if (quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData)) | 104 if (quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData)) |
96 appendQuadsData.numMissingTiles++; | 105 appendQuadsData.numMissingTiles++; |
97 } | 106 } |
98 continue; | 107 continue; |
99 } | 108 } |
100 | 109 |
101 gfx::RectF texture_rect = iter.texture_rect(); | 110 gfx::RectF texture_rect = iter.texture_rect(); |
102 gfx::Rect opaque_rect = iter->opaque_rect(); | 111 gfx::Rect opaque_rect = iter->opaque_rect(); |
103 opaque_rect.Intersect(content_rect); | 112 opaque_rect.Intersect(content_rect); |
104 | 113 |
105 bool outside_left_edge = geometry_rect.x() == content_rect.x(); | |
106 bool outside_top_edge = geometry_rect.y() == content_rect.y(); | |
107 bool outside_right_edge = geometry_rect.right() == content_rect.right(); | |
108 bool outside_bottom_edge = geometry_rect.bottom() == content_rect.bottom(); | |
109 | |
110 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); | 114 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); |
111 quad->SetNew(sharedQuadState, | 115 quad->SetNew(sharedQuadState, |
112 geometry_rect, | 116 geometry_rect, |
113 opaque_rect, | 117 opaque_rect, |
114 resource, | 118 resource, |
115 texture_rect, | 119 texture_rect, |
116 iter.texture_size(), | 120 iter.texture_size(), |
117 iter->contents_swizzled(), | 121 iter->contents_swizzled(), |
118 outside_left_edge && useAA, | 122 outside_left_edge && useAA, |
119 outside_top_edge && useAA, | 123 outside_top_edge && useAA, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 223 |
220 PictureLayerImpl* pending_twin = static_cast<PictureLayerImpl*>( | 224 PictureLayerImpl* pending_twin = static_cast<PictureLayerImpl*>( |
221 layerTreeImpl()->FindPendingTreeLayerById(id())); | 225 layerTreeImpl()->FindPendingTreeLayerById(id())); |
222 if (!pending_twin) | 226 if (!pending_twin) |
223 return; | 227 return; |
224 DCHECK_EQ(id(), pending_twin->id()); | 228 DCHECK_EQ(id(), pending_twin->id()); |
225 pending_twin->SyncTiling(tiling); | 229 pending_twin->SyncTiling(tiling); |
226 } | 230 } |
227 | 231 |
228 } // namespace cc | 232 } // namespace cc |
OLD | NEW |