Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::UI::Widget::Graphics Class Referenceabstract

#include <graphics.h>

Inheritance diagram for Inkscape::UI::Widget::Graphics:
Inkscape::UI::Widget::CairoGraphics Inkscape::UI::Widget::GLGraphics

Classes

struct  PaintArgs
 

Public Member Functions

virtual ~Graphics ()=default
 
virtual void set_scale_factor (int)=0
 Set the HiDPI scale factor.
 
virtual void set_outlines_enabled (bool)=0
 Whether to maintain a second layer of outline content.
 
virtual void set_background_in_stores (bool)=0
 Whether to assume the first layer is drawn on top of background or transparency.
 
virtual void set_colours (std::uint32_t page, std::uint32_t desk, std::uint32_t border)=0
 Set colours for background/page shadow drawing.
 
virtual void recreate_store (Geom::IntPoint const &dims)=0
 Set the store to a surface of the given size, of unspecified contents.
 
virtual void shift_store (Fragment const &dest)=0
 Called when the store fragment shifts position to dest.
 
virtual void swap_stores ()=0
 Exchange the store and snapshot surfaces.
 
virtual void fast_snapshot_combine ()=0
 Paste the store onto the snapshot.
 
virtual void snapshot_combine (Fragment const &dest)=0
 Paste the snapshot followed by the store onto a new snapshot at dest.
 
virtual void invalidate_snapshot ()=0
 Indicate that the content in the snapshot store is not going to be used again.
 
virtual bool is_opengl () const =0
 Whether this is an OpenGL backend.
 
virtual void invalidated_glstate ()=0
 Tells the Graphics to no longer rely on any OpenGL state it had set up.
 
virtual Cairo::RefPtr< Cairo::ImageSurface > request_tile_surface (Geom::IntRect const &rect, bool nogl)=0
 Return a surface for drawing on.
 
virtual void draw_tile (Fragment const &fragment, Cairo::RefPtr< Cairo::ImageSurface > surface, Cairo::RefPtr< Cairo::ImageSurface > outline_surface)=0
 Commit the contents of a surface previously issued by request_tile_surface() to the canvas.
 
virtual void junk_tile_surface (Cairo::RefPtr< Cairo::ImageSurface > surface)=0
 Get rid of a surface previously issued by request_tile_surface() without committing it to the canvas.
 
virtual void paint_widget (Fragment const &view, PaintArgs const &args, Cairo::RefPtr< Cairo::Context > const &cr)=0
 

Static Public Member Functions

static std::unique_ptr< Graphicscreate_gl (Prefs const &prefs, Stores const &stores, PageInfo const &pi)
 
static std::unique_ptr< Graphicscreate_cairo (Prefs const &prefs, Stores const &stores, PageInfo const &pi)
 
static bool check_single_page (Fragment const &view, PageInfo const &pi)
 
static std::pair< Geom::IntRect, Geom::IntRectcalc_splitview_cliprects (Geom::IntPoint const &size, Geom::Point const &splitfrac, SplitDirection splitdir)
 
static void paint_splitview_controller (Geom::IntPoint const &size, Geom::Point const &splitfrac, SplitDirection splitdir, SplitDirection hoverdir, Cairo::RefPtr< Cairo::Context > const &cr)
 
static void paint_background (Fragment const &fragment, PageInfo const &pi, std::uint32_t page, std::uint32_t desk, Cairo::RefPtr< Cairo::Context > const &cr)
 

Detailed Description

Definition at line 37 of file graphics.h.

Constructor & Destructor Documentation

◆ ~Graphics()

virtual Inkscape::UI::Widget::Graphics::~Graphics ( )
virtualdefault

Member Function Documentation

◆ calc_splitview_cliprects()

std::pair< Geom::IntRect, Geom::IntRect > Inkscape::UI::Widget::Graphics::calc_splitview_cliprects ( Geom::IntPoint const &  size,
Geom::Point const &  splitfrac,
SplitDirection  splitdir 
)
static

◆ check_single_page()

bool Inkscape::UI::Widget::Graphics::check_single_page ( Fragment const &  view,
PageInfo const &  pi 
)
static

◆ create_cairo()

std::unique_ptr< Graphics > Inkscape::UI::Widget::Graphics::create_cairo ( Prefs const &  prefs,
Stores const &  stores,
PageInfo const &  pi 
)
static

Definition at line 17 of file cairographics.cpp.

◆ create_gl()

std::unique_ptr< Graphics > Inkscape::UI::Widget::Graphics::create_gl ( Prefs const &  prefs,
Stores const &  stores,
PageInfo const &  pi 
)
static

Definition at line 355 of file glgraphics.cpp.

◆ draw_tile()

virtual void Inkscape::UI::Widget::Graphics::draw_tile ( Fragment const &  fragment,
Cairo::RefPtr< Cairo::ImageSurface >  surface,
Cairo::RefPtr< Cairo::ImageSurface >  outline_surface 
)
pure virtual

Commit the contents of a surface previously issued by request_tile_surface() to the canvas.

In outline mode, a second surface must be passed containing the outline content, otherwise it should be null.

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

◆ fast_snapshot_combine()

virtual void Inkscape::UI::Widget::Graphics::fast_snapshot_combine ( )
pure virtual

◆ invalidate_snapshot()

virtual void Inkscape::UI::Widget::Graphics::invalidate_snapshot ( )
pure virtual

Indicate that the content in the snapshot store is not going to be used again.

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

◆ invalidated_glstate()

virtual void Inkscape::UI::Widget::Graphics::invalidated_glstate ( )
pure virtual

Tells the Graphics to no longer rely on any OpenGL state it had set up.

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

◆ is_opengl()

virtual bool Inkscape::UI::Widget::Graphics::is_opengl ( ) const
pure virtual

◆ junk_tile_surface()

virtual void Inkscape::UI::Widget::Graphics::junk_tile_surface ( Cairo::RefPtr< Cairo::ImageSurface >  surface)
pure virtual

Get rid of a surface previously issued by request_tile_surface() without committing it to the canvas.

Usually useful only to dispose of surfaces which have gone into an error state while rendering, which is irreversible, and therefore we can't do anything useful with them.

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

◆ paint_background()

void Inkscape::UI::Widget::Graphics::paint_background ( Fragment const &  fragment,
PageInfo const &  pi,
std::uint32_t  page,
std::uint32_t  desk,
Cairo::RefPtr< Cairo::Context > const &  cr 
)
static

◆ paint_splitview_controller()

void Inkscape::UI::Widget::Graphics::paint_splitview_controller ( Geom::IntPoint const &  size,
Geom::Point const &  splitfrac,
SplitDirection  splitdir,
SplitDirection  hoverdir,
Cairo::RefPtr< Cairo::Context > const &  cr 
)
static

◆ paint_widget()

virtual void Inkscape::UI::Widget::Graphics::paint_widget ( Fragment const &  view,
PaintArgs const &  args,
Cairo::RefPtr< Cairo::Context > const &  cr 
)
pure virtual

◆ recreate_store()

virtual void Inkscape::UI::Widget::Graphics::recreate_store ( Geom::IntPoint const &  dims)
pure virtual

Set the store to a surface of the given size, of unspecified contents.

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

Referenced by Inkscape::UI::Widget::Stores::recreate_store().

◆ request_tile_surface()

virtual Cairo::RefPtr< Cairo::ImageSurface > Inkscape::UI::Widget::Graphics::request_tile_surface ( Geom::IntRect const &  rect,
bool  nogl 
)
pure virtual

Return a surface for drawing on.

If nogl is true, no GL commands are issued, as is a requirement off-main-thread. All such surfaces must be returned by passing them either to draw_tile() or junk_tile_surface().

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

◆ set_background_in_stores()

virtual void Inkscape::UI::Widget::Graphics::set_background_in_stores ( bool  )
pure virtual

Whether to assume the first layer is drawn on top of background or transparency.

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

◆ set_colours()

virtual void Inkscape::UI::Widget::Graphics::set_colours ( std::uint32_t  page,
std::uint32_t  desk,
std::uint32_t  border 
)
pure virtual

Set colours for background/page shadow drawing.

◆ set_outlines_enabled()

virtual void Inkscape::UI::Widget::Graphics::set_outlines_enabled ( bool  )
pure virtual

Whether to maintain a second layer of outline content.

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

◆ set_scale_factor()

virtual void Inkscape::UI::Widget::Graphics::set_scale_factor ( int  )
pure virtual

Set the HiDPI scale factor.

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

◆ shift_store()

virtual void Inkscape::UI::Widget::Graphics::shift_store ( Fragment const &  dest)
pure virtual

Called when the store fragment shifts position to dest.

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

Referenced by Inkscape::UI::Widget::Stores::shift_store().

◆ snapshot_combine()

virtual void Inkscape::UI::Widget::Graphics::snapshot_combine ( Fragment const &  dest)
pure virtual

Paste the snapshot followed by the store onto a new snapshot at dest.

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

Referenced by Inkscape::UI::Widget::Stores::snapshot_combine().

◆ swap_stores()

virtual void Inkscape::UI::Widget::Graphics::swap_stores ( )
pure virtual

Exchange the store and snapshot surfaces.

Implemented in Inkscape::UI::Widget::CairoGraphics, and Inkscape::UI::Widget::GLGraphics.

Referenced by Inkscape::UI::Widget::Stores::take_snapshot().


The documentation for this class was generated from the following files: