Pepper_31_C++_interfaces
Public Member Functions | Static Public Member Functions | List of all members
pp::Graphics2D_Dev Class Reference

#include <graphics_2d_dev.h>

Inheritance diagram for pp::Graphics2D_Dev:
Inheritance graph
Collaboration diagram for pp::Graphics2D_Dev:
Collaboration graph

Public Member Functions

 Graphics2D_Dev ()
 
 Graphics2D_Dev (const Graphics2D &other)
 
virtual ~Graphics2D_Dev ()
 
bool SetScale (float scale)
 
float GetScale ()
 
- Public Member Functions inherited from pp::Graphics2D
 Graphics2D ()
 
 Graphics2D (const Graphics2D &other)
 
 Graphics2D (const InstanceHandle &instance, const Size &size, bool is_always_opaque)
 
virtual ~Graphics2D ()
 
Graphics2Doperator= (const Graphics2D &other)
 
const Sizesize () const
 
void PaintImageData (const ImageData &image, const Point &top_left)
 
void PaintImageData (const ImageData &image, const Point &top_left, const Rect &src_rect)
 
void Scroll (const Rect &clip, const Point &amount)
 
void ReplaceContents (ImageData *image)
 
int32_t Flush (const CompletionCallback &cc)
 
bool SetScale (float scale)
 
float GetScale ()
 
- Public Member Functions inherited from pp::Resource
 Resource ()
 The default constructor. More...
 
 Resource (const Resource &other)
 
virtual ~Resource ()
 Destructor. More...
 
Resourceoperator= (const Resource &other)
 
bool is_null () const
 
PP_Resource pp_resource () const
 
PP_Resource detach ()
 

Static Public Member Functions

static bool SupportsScale ()
 Returns true if SetScale and GetScale are supported. False if not. More...
 

Additional Inherited Members

- Protected Member Functions inherited from pp::Resource
 Resource (PP_Resource resource)
 
 Resource (PassRef, PP_Resource resource)
 
void PassRefFromConstructor (PP_Resource resource)
 

Detailed Description

Definition at line 14 of file graphics_2d_dev.h.

Constructor & Destructor Documentation

pp::Graphics2D_Dev::Graphics2D_Dev ( )
inline

Default constructor for creating an is_null() Graphics2D_Dev object.

Definition at line 18 of file graphics_2d_dev.h.

pp::Graphics2D_Dev::Graphics2D_Dev ( const Graphics2D other)
inline

Definition at line 22 of file graphics_2d_dev.h.

virtual pp::Graphics2D_Dev::~Graphics2D_Dev ( )
inlinevirtual

Definition at line 24 of file graphics_2d_dev.h.

Member Function Documentation

float pp::Graphics2D_Dev::GetScale ( )

GetScale() gets the scale factor that will be applied when painting the graphics context onto the output device.

Returns
Returns the scale factor for the graphics context. If the resource is invalid, 0.0 will be returned.
bool pp::Graphics2D_Dev::SetScale ( float  scale)

SetScale() sets the scale factor that will be applied when painting the graphics context onto the output device. Typically, if rendering at device resolution is desired, the context would be created with the width and height scaled up by the view's GetDeviceScale and SetScale called with a scale of 1.0 / GetDeviceScale(). For example, if the view resource passed to DidChangeView has a rectangle of (w=200, h=100) and a device scale of 2.0, one would call Create with a size of (w=400, h=200) and then call SetScale with 0.5. One would then treat each pixel in the context as a single device pixel.

Parameters
[in]scaleThe scale to apply when painting.
Returns
Returns true on success or false if the resource is invalid or the scale factor is 0 or less.
static bool pp::Graphics2D_Dev::SupportsScale ( )
static

Returns true if SetScale and GetScale are supported. False if not.


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