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

Side by Side Diff: cc/layer.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 reviews. 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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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.h" 5 #include "cc/layer.h"
6 6
7 #include "cc/active_animation.h" 7 #include "cc/active_animation.h"
8 #include "cc/animation_events.h" 8 #include "cc/animation_events.h"
9 #include "cc/layer_animation_controller.h" 9 #include "cc/layer_animation_controller.h"
10 #include "cc/layer_impl.h" 10 #include "cc/layer_impl.h"
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 setNeedsDisplay(); 691 setNeedsDisplay();
692 } 692 }
693 693
694 void Layer::createRenderSurface() 694 void Layer::createRenderSurface()
695 { 695 {
696 DCHECK(!m_renderSurface); 696 DCHECK(!m_renderSurface);
697 m_renderSurface = make_scoped_ptr(new RenderSurface(this)); 697 m_renderSurface = make_scoped_ptr(new RenderSurface(this));
698 setRenderTarget(this); 698 setRenderTarget(this);
699 } 699 }
700 700
701 bool Layer::descendantDrawsContent() 701 int Layer::descendantsDrawContent()
702 { 702 {
703 int result = 0;
703 for (size_t i = 0; i < m_children.size(); ++i) { 704 for (size_t i = 0; i < m_children.size(); ++i) {
704 if (m_children[i]->drawsContent() || m_children[i]->descendantDrawsConte nt()) 705 if (m_children[i]->drawsContent())
705 return true; 706 ++result;
707 result += m_children[i]->descendantsDrawContent();
708 if (result > 1)
709 return result;
706 } 710 }
707 return false; 711 return result;
708 } 712 }
709 713
710 int Layer::id() const 714 int Layer::id() const
711 { 715 {
712 return m_layerId; 716 return m_layerId;
713 } 717 }
714 718
715 float Layer::opacity() const 719 float Layer::opacity() const
716 { 720 {
717 return m_opacity; 721 return m_opacity;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 { 838 {
835 return 0; 839 return 0;
836 } 840 }
837 841
838 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*) 842 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*)
839 { 843 {
840 // Currently we don't use z-order to decide what to paint, so there's no nee d to actually sort Layers. 844 // Currently we don't use z-order to decide what to paint, so there's no nee d to actually sort Layers.
841 } 845 }
842 846
843 } // namespace cc 847 } // namespace cc
OLDNEW
« cc/delegated_renderer_layer_impl.cc ('K') | « cc/layer.h ('k') | cc/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698