DisplaySVGItem.h (1488B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef LAYOUT_SVG_DISPLAYSVGITEM_H_ 8 #define LAYOUT_SVG_DISPLAYSVGITEM_H_ 9 10 #include "nsDisplayList.h" 11 12 namespace mozilla { 13 14 //---------------------------------------------------------------------- 15 // Display list item: 16 17 class DisplaySVGItem : public nsPaintedDisplayItem { 18 public: 19 DisplaySVGItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame) 20 : nsPaintedDisplayItem(aBuilder, aFrame) { 21 MOZ_ASSERT(aFrame, "Must have a frame!"); 22 } 23 24 /** 25 * Hit testing for display lists. 26 * @param aRect the point or rect being tested, relative to aFrame. 27 * If the width and height are both 1 app unit, it indicates we're 28 * hit testing a point, not a rect. 29 * @param aOutFrames each item appends the frame(s) in this display item that 30 * the rect is considered over (if any) to aOutFrames. 31 */ 32 void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, 33 HitTestState* aState, nsTArray<nsIFrame*>* aOutFrames) override; 34 /** 35 * Paint the frame to some rendering context. 36 */ 37 void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override; 38 }; 39 40 } // namespace mozilla 41 42 #endif // LAYOUT_SVG_DISPLAYSVGITEM_H_