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

Side by Side Diff: sky/engine/core/rendering/RenderBox.h

Issue 1017593005: Add a basic custom painting facility to Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add missing files Created 5 years, 9 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 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 bool hasRenderOverflow() const { return m_overflow; } 443 bool hasRenderOverflow() const { return m_overflow; }
444 bool hasVisualOverflow() const { return m_overflow && !borderBoxRect().conta ins(m_overflow->visualOverflowRect()); } 444 bool hasVisualOverflow() const { return m_overflow && !borderBoxRect().conta ins(m_overflow->visualOverflowRect()); }
445 445
446 virtual bool needsPreferredWidthsRecalculation() const; 446 virtual bool needsPreferredWidthsRecalculation() const;
447 virtual void computeIntrinsicRatioInformation(FloatSize& /* intrinsicSize */ , double& /* intrinsicRatio */) const { } 447 virtual void computeIntrinsicRatioInformation(FloatSize& /* intrinsicSize */ , double& /* intrinsicRatio */) const { }
448 448
449 virtual bool hasRelativeLogicalHeight() const; 449 virtual bool hasRelativeLogicalHeight() const;
450 450
451 bool hasSameDirectionAs(const RenderBox* object) const { return style()->dir ection() == object->style()->direction(); } 451 bool hasSameDirectionAs(const RenderBox* object) const { return style()->dir ection() == object->style()->direction(); }
452 452
453 void setCustomPainting(PassRefPtr<DisplayList> customPainting) { m_customPai nting = customPainting; }
454
453 protected: 455 protected:
454 virtual void willBeDestroyed() override; 456 virtual void willBeDestroyed() override;
455 457
456 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) o verride; 458 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) o verride;
457 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov erride; 459 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov erride;
458 460
459 void paintBackground(const PaintInfo&, const LayoutRect&, const Color& backg roundColor, BackgroundBleedAvoidance = BackgroundBleedNone); 461 void paintBackground(const PaintInfo&, const LayoutRect&, const Color& backg roundColor, BackgroundBleedAvoidance = BackgroundBleedNone);
460 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance, RenderObject* backgroundObject, bool skip BaseColor = false); 462 void paintFillLayer(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance, RenderObject* backgroundObject, bool skip BaseColor = false);
461 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, RenderObject* back groundObject = 0); 463 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, RenderObject* back groundObject = 0);
462 void paintBoxDecorationBackgroundWithRect(PaintInfo&, const LayoutPoint&, co nst LayoutRect&); 464 void paintBoxDecorationBackgroundWithRect(PaintInfo&, const LayoutPoint&, co nst LayoutRect&);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 LayoutUnit m_maxPreferredLogicalWidth; 564 LayoutUnit m_maxPreferredLogicalWidth;
563 565
564 // Our overflow information. 566 // Our overflow information.
565 OwnPtr<RenderOverflow> m_overflow; 567 OwnPtr<RenderOverflow> m_overflow;
566 568
567 // TODO(ojan): Move these two into RenderBoxRareData. 569 // TODO(ojan): Move these two into RenderBoxRareData.
568 OwnPtr<FilterEffectRenderer> m_filterRenderer; 570 OwnPtr<FilterEffectRenderer> m_filterRenderer;
569 OwnPtr<TransformationMatrix> m_transform; 571 OwnPtr<TransformationMatrix> m_transform;
570 572
571 private: 573 private:
574 RefPtr<DisplayList> m_customPainting;
572 OwnPtr<RenderLayer> m_layer; 575 OwnPtr<RenderLayer> m_layer;
573 OwnPtr<RenderBoxRareData> m_rareData; 576 OwnPtr<RenderBoxRareData> m_rareData;
574 }; 577 };
575 578
576 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBox, isBox()); 579 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBox, isBox());
577 580
578 inline RenderBox* RenderBox::previousSiblingBox() const 581 inline RenderBox* RenderBox::previousSiblingBox() const
579 { 582 {
580 return toRenderBox(previousSibling()); 583 return toRenderBox(previousSibling());
581 } 584 }
(...skipping 29 matching lines...) Expand all
611 if (UNLIKELY(inlineBoxWrapper() != 0)) 614 if (UNLIKELY(inlineBoxWrapper() != 0))
612 deleteLineBoxWrapper(); 615 deleteLineBoxWrapper();
613 } 616 }
614 617
615 ensureRareData().m_inlineBoxWrapper = boxWrapper; 618 ensureRareData().m_inlineBoxWrapper = boxWrapper;
616 } 619 }
617 620
618 } // namespace blink 621 } // namespace blink
619 622
620 #endif // SKY_ENGINE_CORE_RENDERING_RENDERBOX_H_ 623 #endif // SKY_ENGINE_CORE_RENDERING_RENDERBOX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698