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

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: Addressing code review. 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
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 m_children.clear(); 107 m_children.clear();
108 } 108 }
109 109
110 void LayerImpl::createRenderSurface() 110 void LayerImpl::createRenderSurface()
111 { 111 {
112 DCHECK(!m_renderSurface); 112 DCHECK(!m_renderSurface);
113 m_renderSurface = make_scoped_ptr(new RenderSurfaceImpl(this)); 113 m_renderSurface = make_scoped_ptr(new RenderSurfaceImpl(this));
114 setRenderTarget(this); 114 setRenderTarget(this);
115 } 115 }
116 116
117 bool LayerImpl::descendantDrawsContent()
118 {
119 for (size_t i = 0; i < m_children.size(); ++i) {
120 if (m_children[i]->drawsContent() || m_children[i]->descendantDrawsConte nt())
121 return true;
122 }
123 return false;
124 }
125
126 scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const 117 scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const
127 { 118 {
128 scoped_ptr<SharedQuadState> state = SharedQuadState::Create(); 119 scoped_ptr<SharedQuadState> state = SharedQuadState::Create();
129 state->SetAll(m_drawTransform, m_visibleContentRect, m_drawableContentRect, m_ clipRect, m_isClipped, m_drawOpacity); 120 state->SetAll(m_drawTransform, m_visibleContentRect, m_drawableContentRect, m_ clipRect, m_isClipped, m_drawOpacity);
130 return state.Pass(); 121 return state.Pass();
131 } 122 }
132 123
133 void LayerImpl::willDraw(ResourceProvider*) 124 void LayerImpl::willDraw(ResourceProvider*)
134 { 125 {
135 #ifndef NDEBUG 126 #ifndef NDEBUG
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 715
725 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer) 716 void LayerImpl::setVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbarLayer)
726 { 717 {
727 if (!m_scrollbarAnimationController) 718 if (!m_scrollbarAnimationController)
728 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is); 719 m_scrollbarAnimationController = ScrollbarAnimationController::create(th is);
729 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); 720 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer);
730 m_scrollbarAnimationController->updateScrollOffset(this); 721 m_scrollbarAnimationController->updateScrollOffset(this);
731 } 722 }
732 723
733 } // namespace cc 724 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698