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

Side by Side Diff: sky/engine/core/rendering/RenderLayerModelObject.cpp

Issue 945693002: Move hit testing out of RenderLayer into RenderBox. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: add to test case Created 5 years, 10 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved. 7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 m_layer = adoptPtr(new RenderLayer(this, type)); 55 m_layer = adoptPtr(new RenderLayer(this, type));
56 setHasLayer(true); 56 setHasLayer(true);
57 m_layer->insertOnlyThisLayer(); 57 m_layer->insertOnlyThisLayer();
58 } 58 }
59 59
60 bool RenderLayerModelObject::hasSelfPaintingLayer() const 60 bool RenderLayerModelObject::hasSelfPaintingLayer() const
61 { 61 {
62 return m_layer && m_layer->isSelfPaintingLayer(); 62 return m_layer && m_layer->isSelfPaintingLayer();
63 } 63 }
64 64
65 void RenderLayerModelObject::collectSelfPaintingLayers(Vector<RenderBox*>& layer s)
66 {
67 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli ng()) {
68 if (child->isBox()) {
69 RenderBox* childBox = toRenderBox(child);
70 if (childBox->hasSelfPaintingLayer())
71 layers.append(childBox);
72 else
73 childBox->collectSelfPaintingLayers(layers);
74 } else if (child->isLayerModelObject()) {
75 toRenderLayerModelObject(child)->collectSelfPaintingLayers(layers);
76 }
77 }
78 }
79
65 void RenderLayerModelObject::willBeDestroyed() 80 void RenderLayerModelObject::willBeDestroyed()
66 { 81 {
67 RenderObject::willBeDestroyed(); 82 RenderObject::willBeDestroyed();
68 destroyLayer(); 83 destroyLayer();
69 } 84 }
70 85
71 void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderS tyle& newStyle) 86 void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderS tyle& newStyle)
72 { 87 {
73 if (RenderStyle* oldStyle = style()) { 88 if (RenderStyle* oldStyle = style()) {
74 if (parent()) { 89 if (parent()) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (layer()) { 122 if (layer()) {
108 // FIXME: Ideally we shouldn't need this setter but we can't easily infe r an overflow-only layer 123 // FIXME: Ideally we shouldn't need this setter but we can't easily infe r an overflow-only layer
109 // from the style. 124 // from the style.
110 layer()->setLayerType(type); 125 layer()->setLayerType(type);
111 layer()->styleChanged(diff, oldStyle); 126 layer()->styleChanged(diff, oldStyle);
112 } 127 }
113 } 128 }
114 129
115 } // namespace blink 130 } // namespace blink
116 131
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderLayerModelObject.h ('k') | sky/engine/core/rendering/RenderView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698