Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: cc/layer_impl.cc

Issue 11316171: Don't create render passes for transparent images. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_iterator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/debug_border_draw_quad.h" 9 #include "cc/debug_border_draw_quad.h"
10 #include "cc/debug_colors.h" 10 #include "cc/debug_colors.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 m_children.clear(); 105 m_children.clear();
106 } 106 }
107 107
108 void LayerImpl::createRenderSurface() 108 void LayerImpl::createRenderSurface()
109 { 109 {
110 DCHECK(!m_renderSurface); 110 DCHECK(!m_renderSurface);
111 m_renderSurface = make_scoped_ptr(new RenderSurfaceImpl(this)); 111 m_renderSurface = make_scoped_ptr(new RenderSurfaceImpl(this));
112 setRenderTarget(this); 112 setRenderTarget(this);
113 } 113 }
114 114
115 bool LayerImpl::descendantDrawsContent() 115 int LayerImpl::descendantsDrawContent()
116 { 116 {
117 int result = 0;
117 for (size_t i = 0; i < m_children.size(); ++i) { 118 for (size_t i = 0; i < m_children.size(); ++i) {
118 if (m_children[i]->drawsContent() || m_children[i]->descendantDrawsConte nt()) 119 if (m_children[i]->drawsContent())
119 return true; 120 ++result;
121 result += m_children[i]->descendantsDrawContent();
122 if (result > 1)
123 return result;
120 } 124 }
121 return false; 125 return result;
122 } 126 }
123 127
124 scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const 128 scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const
125 { 129 {
126 scoped_ptr<SharedQuadState> state = SharedQuadState::Create(); 130 scoped_ptr<SharedQuadState> state = SharedQuadState::Create();
127 state->SetAll(m_drawTransform, m_visibleContentRect, m_drawableContentRect, m_ clipRect, m_isClipped, m_drawOpacity); 131 state->SetAll(m_drawTransform, m_visibleContentRect, m_drawableContentRect, m_ clipRect, m_isClipped, m_drawOpacity);
128 return state.Pass(); 132 return state.Pass();
129 } 133 }
130 134
131 void LayerImpl::willDraw(ResourceProvider*) 135 void LayerImpl::willDraw(ResourceProvider*)
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 726
723 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) 727 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer)
724 { 728 {
725 if (!m_scrollbarAnimationController) 729 if (!m_scrollbarAnimationController)
726 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is); 730 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is);
727 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); 731 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer);
728 m_scrollbarAnimationController->updateScrollOffset(this); 732 m_scrollbarAnimationController->updateScrollOffset(this);
729 } 733 }
730 734
731 } // namespace cc 735 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_iterator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698