6 #include "graphicsbuffer.h"
7 #include "framebuffer.h"
8 #include "shaderprogram.h"
15 View(Document & document, const Rect & bounds = Rect(0,0,1,1), const Colour & colour = Colour(0.f,0.f,0.f,1.f))
16 : m_colour(colour), m_use_gpu_transform(false), m_bounds_dirty(true), m_buffer_dirty(true), m_document(document), m_bounds(bounds)
18 Debug("View Created - Bounds => {%s}", m_bounds.Str().c_str());
22 void Render(int width = 0, int height = 0);
24 void Translate(Real x, Real y);
25 void ScaleAroundPoint(Real x, Real y, Real scaleAmt);
27 Rect TransformToViewCoords(const Rect& inp) const;
29 const Rect& GetBounds() const { return m_bounds; }
31 const bool UsingGPUTransform() const { return m_use_gpu_transform; }
32 void ToggleGPUTransform() { m_use_gpu_transform = (!m_use_gpu_transform); m_bounds_dirty = true; m_buffer_dirty = true; }
37 bool m_use_gpu_transform;
40 ShaderProgram m_rect_shader;
41 GraphicsBuffer m_bounds_ubo;
42 GraphicsBuffer m_vertex_buffer;
43 GraphicsBuffer m_index_buffer;
44 FrameBuffer m_cached_display;
45 Document & m_document;
48 uint32_t m_rendered_filled;
49 uint32_t m_rendered_outline;