| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layer_impl.h" | 5 #include "cc/layer_impl.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "cc/debug_border_draw_quad.h" | 10 #include "cc/debug_border_draw_quad.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 layerTreeHostImpl()->setNeedsUpdateDrawProperties(); | 101 layerTreeHostImpl()->setNeedsUpdateDrawProperties(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void LayerImpl::createRenderSurface() | 104 void LayerImpl::createRenderSurface() |
| 105 { | 105 { |
| 106 DCHECK(!m_drawProperties.render_surface); | 106 DCHECK(!m_drawProperties.render_surface); |
| 107 m_drawProperties.render_surface = make_scoped_ptr(new RenderSurfaceImpl(this
)); | 107 m_drawProperties.render_surface = make_scoped_ptr(new RenderSurfaceImpl(this
)); |
| 108 m_drawProperties.render_target = this; | 108 m_drawProperties.render_target = this; |
| 109 } | 109 } |
| 110 | 110 |
| 111 int LayerImpl::descendantsDrawContent() | |
| 112 { | |
| 113 int result = 0; | |
| 114 for (size_t i = 0; i < m_children.size(); ++i) { | |
| 115 if (m_children[i]->drawsContent()) | |
| 116 ++result; | |
| 117 result += m_children[i]->descendantsDrawContent(); | |
| 118 if (result > 1) | |
| 119 return result; | |
| 120 } | |
| 121 return result; | |
| 122 } | |
| 123 | |
| 124 LayerTreeHostImpl* LayerImpl::layerTreeHostImpl() const { | 111 LayerTreeHostImpl* LayerImpl::layerTreeHostImpl() const { |
| 125 return m_layerTreeImpl->layer_tree_host_impl(); | 112 return m_layerTreeImpl->layer_tree_host_impl(); |
| 126 } | 113 } |
| 127 | 114 |
| 128 scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const | 115 scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const |
| 129 { | 116 { |
| 130 scoped_ptr<SharedQuadState> state = SharedQuadState::Create(); | 117 scoped_ptr<SharedQuadState> state = SharedQuadState::Create(); |
| 131 state->SetAll(m_drawProperties.target_space_transform, | 118 state->SetAll(m_drawProperties.target_space_transform, |
| 132 m_drawProperties.visible_content_rect, | 119 m_drawProperties.visible_content_rect, |
| 133 m_drawProperties.drawable_content_rect, | 120 m_drawProperties.drawable_content_rect, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 SkColor color; | 172 SkColor color; |
| 186 float width; | 173 float width; |
| 187 getDebugBorderProperties(&color, &width); | 174 getDebugBorderProperties(&color, &width); |
| 188 | 175 |
| 189 gfx::Rect contentRect(gfx::Point(), contentBounds()); | 176 gfx::Rect contentRect(gfx::Point(), contentBounds()); |
| 190 scoped_ptr<DebugBorderDrawQuad> debugBorderQuad = DebugBorderDrawQuad::Creat
e(); | 177 scoped_ptr<DebugBorderDrawQuad> debugBorderQuad = DebugBorderDrawQuad::Creat
e(); |
| 191 debugBorderQuad->SetNew(sharedQuadState, contentRect, color, width); | 178 debugBorderQuad->SetNew(sharedQuadState, contentRect, color, width); |
| 192 quadList.append(debugBorderQuad.PassAs<DrawQuad>(), appendQuadsData); | 179 quadList.append(debugBorderQuad.PassAs<DrawQuad>(), appendQuadsData); |
| 193 } | 180 } |
| 194 | 181 |
| 182 bool LayerImpl::hasDelegatedContent() const |
| 183 { |
| 184 return false; |
| 185 } |
| 186 |
| 195 bool LayerImpl::hasContributingDelegatedRenderPasses() const | 187 bool LayerImpl::hasContributingDelegatedRenderPasses() const |
| 196 { | 188 { |
| 197 return false; | 189 return false; |
| 198 } | 190 } |
| 199 | 191 |
| 200 RenderPass::Id LayerImpl::firstContributingRenderPassId() const | 192 RenderPass::Id LayerImpl::firstContributingRenderPassId() const |
| 201 { | 193 { |
| 202 return RenderPass::Id(0, 0); | 194 return RenderPass::Id(0, 0); |
| 203 } | 195 } |
| 204 | 196 |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 | 772 |
| 781 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) | 773 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) |
| 782 { | 774 { |
| 783 if (!m_scrollbarAnimationController) | 775 if (!m_scrollbarAnimationController) |
| 784 m_scrollbarAnimationController = ScrollbarAnimationController::create(th
is); | 776 m_scrollbarAnimationController = ScrollbarAnimationController::create(th
is); |
| 785 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); | 777 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); |
| 786 m_scrollbarAnimationController->updateScrollOffset(this); | 778 m_scrollbarAnimationController->updateScrollOffset(this); |
| 787 } | 779 } |
| 788 | 780 |
| 789 } // namespace cc | 781 } // namespace cc |
| OLD | NEW |