| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003 Apple Computer, Inc. | 2 * Copyright (C) 2003 Apple Computer, Inc. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 static const ScrollAlignment gAlignCenterIfNeeded; | 179 static const ScrollAlignment gAlignCenterIfNeeded; |
| 180 static const ScrollAlignment gAlignToEdgeIfNeeded; | 180 static const ScrollAlignment gAlignToEdgeIfNeeded; |
| 181 static const ScrollAlignment gAlignCenterAlways; | 181 static const ScrollAlignment gAlignCenterAlways; |
| 182 static const ScrollAlignment gAlignTopAlways; | 182 static const ScrollAlignment gAlignTopAlways; |
| 183 static const ScrollAlignment gAlignBottomAlways; | 183 static const ScrollAlignment gAlignBottomAlways; |
| 184 | 184 |
| 185 static ScrollBehavior getVisibleBehavior(const ScrollAlignment& s) { return
s.m_rectVisible; } | 185 static ScrollBehavior getVisibleBehavior(const ScrollAlignment& s) { return
s.m_rectVisible; } |
| 186 static ScrollBehavior getPartialBehavior(const ScrollAlignment& s) { return
s.m_rectPartial; } | 186 static ScrollBehavior getPartialBehavior(const ScrollAlignment& s) { return
s.m_rectPartial; } |
| 187 static ScrollBehavior getHiddenBehavior(const ScrollAlignment& s) { return s
.m_rectHidden; } | 187 static ScrollBehavior getHiddenBehavior(const ScrollAlignment& s) { return s
.m_rectHidden; } |
| 188 | 188 |
| 189 RenderLayer(RenderBoxModelObject*); | 189 RenderLayer(RenderBox*); |
| 190 ~RenderLayer(); | 190 ~RenderLayer(); |
| 191 | 191 |
| 192 RenderBoxModelObject* renderer() const { return m_renderer; } | 192 RenderBox* renderer() const { return m_renderer; } |
| 193 RenderBox* renderBox() const { return m_renderer && m_renderer->isBox() ? to
RenderBox(m_renderer) : 0; } | |
| 194 RenderLayer* parent() const { return m_parent; } | 193 RenderLayer* parent() const { return m_parent; } |
| 195 RenderLayer* previousSibling() const { return m_previous; } | 194 RenderLayer* previousSibling() const { return m_previous; } |
| 196 RenderLayer* nextSibling() const { return m_next; } | 195 RenderLayer* nextSibling() const { return m_next; } |
| 197 RenderLayer* firstChild() const { return m_first; } | 196 RenderLayer* firstChild() const { return m_first; } |
| 198 RenderLayer* lastChild() const { return m_last; } | 197 RenderLayer* lastChild() const { return m_last; } |
| 199 | 198 |
| 200 void addChild(RenderLayer* newChild, RenderLayer* beforeChild = 0); | 199 void addChild(RenderLayer* newChild, RenderLayer* beforeChild = 0); |
| 201 RenderLayer* removeChild(RenderLayer*); | 200 RenderLayer* removeChild(RenderLayer*); |
| 202 | 201 |
| 203 void removeOnlyThisLayer(); | 202 void removeOnlyThisLayer(); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 377 |
| 379 void updateHoverActiveState(const HitTestRequest&, HitTestResult&); | 378 void updateHoverActiveState(const HitTestRequest&, HitTestResult&); |
| 380 | 379 |
| 381 // Return a cached repaint rect, computed relative to the layer renderer's c
ontainerForRepaint. | 380 // Return a cached repaint rect, computed relative to the layer renderer's c
ontainerForRepaint. |
| 382 IntRect repaintRect() const { return m_repaintRect; } | 381 IntRect repaintRect() const { return m_repaintRect; } |
| 383 void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; } | 382 void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; } |
| 384 | 383 |
| 385 int staticX() const { return m_staticX; } | 384 int staticX() const { return m_staticX; } |
| 386 int staticY() const { return m_staticY; } | 385 int staticY() const { return m_staticY; } |
| 387 void setStaticX(int staticX) { m_staticX = staticX; } | 386 void setStaticX(int staticX) { m_staticX = staticX; } |
| 388 void setStaticY(int staticY); | 387 void setStaticY(int staticY) { m_staticY = staticY; } |
| 389 | 388 |
| 390 bool hasTransform() const { return renderer()->hasTransform(); } | 389 bool hasTransform() const { return renderer()->hasTransform(); } |
| 391 // Note that this transform has the transform-origin baked in. | 390 // Note that this transform has the transform-origin baked in. |
| 392 TransformationMatrix* transform() const { return m_transform.get(); } | 391 TransformationMatrix* transform() const { return m_transform.get(); } |
| 393 | 392 |
| 394 void destroy(RenderArena*); | 393 void destroy(RenderArena*); |
| 395 | 394 |
| 396 // Overloaded new operator. Derived classes must override operator new | 395 // Overloaded new operator. Derived classes must override operator new |
| 397 // in order to allocate out of the RenderArena. | 396 // in order to allocate out of the RenderArena. |
| 398 void* operator new(size_t, RenderArena*) throw(); | 397 void* operator new(size_t, RenderArena*) throw(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 423 // The normal operator new is disallowed on all render objects. | 422 // The normal operator new is disallowed on all render objects. |
| 424 void* operator new(size_t) throw(); | 423 void* operator new(size_t) throw(); |
| 425 | 424 |
| 426 private: | 425 private: |
| 427 void setNextSibling(RenderLayer* next) { m_next = next; } | 426 void setNextSibling(RenderLayer* next) { m_next = next; } |
| 428 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } | 427 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } |
| 429 void setParent(RenderLayer* parent); | 428 void setParent(RenderLayer* parent); |
| 430 void setFirstChild(RenderLayer* first) { m_first = first; } | 429 void setFirstChild(RenderLayer* first) { m_first = first; } |
| 431 void setLastChild(RenderLayer* last) { m_last = last; } | 430 void setLastChild(RenderLayer* last) { m_last = last; } |
| 432 | 431 |
| 433 int renderBoxX() const { return renderer()->isBox() ? toRenderBox(renderer()
)->x() : 0; } | |
| 434 int renderBoxY() const { return renderer()->isBox() ? toRenderBox(renderer()
)->y() : 0; } | |
| 435 | |
| 436 void collectLayers(Vector<RenderLayer*>*&, Vector<RenderLayer*>*&); | 432 void collectLayers(Vector<RenderLayer*>*&, Vector<RenderLayer*>*&); |
| 437 | 433 |
| 438 void updateLayerListsIfNeeded(); | 434 void updateLayerListsIfNeeded(); |
| 439 | 435 |
| 440 void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& pai
ntDirtyRect, | 436 void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& pai
ntDirtyRect, |
| 441 bool haveTransparency, PaintRestriction, RenderObject* paint
ingRoot, | 437 bool haveTransparency, PaintRestriction, RenderObject* paint
ingRoot, |
| 442 bool appliedTransform = false, bool temporaryClipRects = fal
se); | 438 bool appliedTransform = false, bool temporaryClipRects = fal
se); |
| 443 RenderLayer* hitTestLayer(RenderLayer* rootLayer, const HitTestRequest&, Hit
TestResult&, const IntRect& hitTestRect, const IntPoint& hitTestPoint, bool appl
iedTransform = false); | 439 RenderLayer* hitTestLayer(RenderLayer* rootLayer, const HitTestRequest&, Hit
TestResult&, const IntRect& hitTestRect, const IntPoint& hitTestPoint, bool appl
iedTransform = false); |
| 444 | 440 |
| 445 void computeScrollDimensions(bool* needHBar = 0, bool* needVBar = 0); | 441 void computeScrollDimensions(bool* needHBar = 0, bool* needVBar = 0); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 474 #if USE(ACCELERATED_COMPOSITING) | 470 #if USE(ACCELERATED_COMPOSITING) |
| 475 bool hasCompositingDescendant() const { return m_hasCompositingDescendant; } | 471 bool hasCompositingDescendant() const { return m_hasCompositingDescendant; } |
| 476 void setHasCompositingDescendant(bool b) { m_hasCompositingDescendant = b;
} | 472 void setHasCompositingDescendant(bool b) { m_hasCompositingDescendant = b;
} |
| 477 #endif | 473 #endif |
| 478 | 474 |
| 479 private: | 475 private: |
| 480 friend class RenderLayerBacking; | 476 friend class RenderLayerBacking; |
| 481 friend class RenderLayerCompositor; | 477 friend class RenderLayerCompositor; |
| 482 | 478 |
| 483 protected: | 479 protected: |
| 484 RenderBoxModelObject* m_renderer; | 480 RenderBox* m_renderer; |
| 485 | 481 |
| 486 RenderLayer* m_parent; | 482 RenderLayer* m_parent; |
| 487 RenderLayer* m_previous; | 483 RenderLayer* m_previous; |
| 488 RenderLayer* m_next; | 484 RenderLayer* m_next; |
| 489 RenderLayer* m_first; | 485 RenderLayer* m_first; |
| 490 RenderLayer* m_last; | 486 RenderLayer* m_last; |
| 491 | 487 |
| 492 IntRect m_repaintRect; // Cached repaint rects. Used by layout. | 488 IntRect m_repaintRect; // Cached repaint rects. Used by layout. |
| 493 IntRect m_outlineBox; | 489 IntRect m_outlineBox; |
| 494 | 490 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 RenderScrollbarPart* m_resizer; | 573 RenderScrollbarPart* m_resizer; |
| 578 | 574 |
| 579 #if USE(ACCELERATED_COMPOSITING) | 575 #if USE(ACCELERATED_COMPOSITING) |
| 580 OwnPtr<RenderLayerBacking> m_backing; | 576 OwnPtr<RenderLayerBacking> m_backing; |
| 581 #endif | 577 #endif |
| 582 }; | 578 }; |
| 583 | 579 |
| 584 } // namespace WebCore | 580 } // namespace WebCore |
| 585 | 581 |
| 586 #endif // RenderLayer_h | 582 #endif // RenderLayer_h |
| OLD | NEW |