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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 bool useAA = !isAxisAlignedInTarget; | 48 bool useAA = !isAxisAlignedInTarget; |
49 | 49 |
50 if (showDebugBorders()) { | 50 if (showDebugBorders()) { |
51 for (PictureLayerTilingSet::Iterator iter(&tilings_, | 51 for (PictureLayerTilingSet::Iterator iter(&tilings_, |
52 contentsScaleX(), | 52 contentsScaleX(), |
53 rect); | 53 rect); |
54 iter; | 54 iter; |
55 ++iter) { | 55 ++iter) { |
56 SkColor color; | 56 SkColor color; |
57 float width; | 57 float width; |
58 if (*iter && iter->resource_id()) { | 58 if (*iter && iter->GetResourceId()) { |
59 color = DebugColors::TileBorderColor(); | 59 color = DebugColors::TileBorderColor(); |
60 width = DebugColors::TileBorderWidth(layerTreeHostImpl()); | 60 width = DebugColors::TileBorderWidth(layerTreeHostImpl()); |
61 } else { | 61 } else { |
62 color = DebugColors::MissingTileBorderColor(); | 62 color = DebugColors::MissingTileBorderColor(); |
63 width = DebugColors::MissingTileBorderWidth(layerTreeHostImpl()); | 63 width = DebugColors::MissingTileBorderWidth(layerTreeHostImpl()); |
64 } | 64 } |
65 | 65 |
66 scoped_ptr<DebugBorderDrawQuad> debugBorderQuad = | 66 scoped_ptr<DebugBorderDrawQuad> debugBorderQuad = |
67 DebugBorderDrawQuad::Create(); | 67 DebugBorderDrawQuad::Create(); |
68 gfx::Rect geometry_rect = iter.geometry_rect(); | 68 gfx::Rect geometry_rect = iter.geometry_rect(); |
69 debugBorderQuad->SetNew(sharedQuadState, geometry_rect, color, width); | 69 debugBorderQuad->SetNew(sharedQuadState, geometry_rect, color, width); |
70 quadSink.append(debugBorderQuad.PassAs<DrawQuad>(), appendQuadsData); | 70 quadSink.append(debugBorderQuad.PassAs<DrawQuad>(), appendQuadsData); |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 for (PictureLayerTilingSet::Iterator iter(&tilings_, contentsScaleX(), rect); | 74 for (PictureLayerTilingSet::Iterator iter(&tilings_, contentsScaleX(), rect); |
75 iter; | 75 iter; |
76 ++iter) { | 76 ++iter) { |
77 ResourceProvider::ResourceId resource = 0; | 77 ResourceProvider::ResourceId resource = 0; |
78 if (*iter) | 78 if (*iter) |
79 resource = iter->resource_id(); | 79 resource = iter->GetResourceId(); |
80 | 80 |
81 gfx::Rect geometry_rect = iter.geometry_rect(); | 81 gfx::Rect geometry_rect = iter.geometry_rect(); |
82 | 82 |
83 if (!resource) { | 83 if (!resource) { |
84 if (drawCheckerboardForMissingTiles()) { | 84 if (drawCheckerboardForMissingTiles()) { |
85 // TODO(enne): Figure out how to show debug "invalidated checker" color | 85 // TODO(enne): Figure out how to show debug "invalidated checker" color |
86 scoped_ptr<CheckerboardDrawQuad> quad = CheckerboardDrawQuad::Create(); | 86 scoped_ptr<CheckerboardDrawQuad> quad = CheckerboardDrawQuad::Create(); |
87 SkColor color = DebugColors::DefaultCheckerboardColor(); | 87 SkColor color = DebugColors::DefaultCheckerboardColor(); |
88 quad->SetNew(sharedQuadState, geometry_rect, color); | 88 quad->SetNew(sharedQuadState, geometry_rect, color); |
89 appendQuadsData.hadMissingTiles |= | 89 appendQuadsData.hadMissingTiles |= |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 GL_RGBA, | 171 GL_RGBA, |
172 rect, | 172 rect, |
173 tiling->contents_scale())); | 173 tiling->contents_scale())); |
174 } | 174 } |
175 | 175 |
176 void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) { | 176 void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) { |
177 tilings_.CloneFrom(other->tilings_); | 177 tilings_.CloneFrom(other->tilings_); |
178 } | 178 } |
179 | 179 |
180 } // namespace cc | 180 } // namespace cc |
OLD | NEW |