Commit db421b32 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

add dpi field to Layer

parent 417905b4
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -16,9 +16,11 @@ Layer::Layer() : width(0), height(0), surface(nullptr), ctx(nullptr) {}

Layer::Layer(
    uint32_t w,
  uint32_t h) :
    uint32_t h,
    uint32_t dpi_ /* = 300 */) :
    width(w),
  height(h) {
    height(h),
    dpi(dpi_) {
  surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
  ctx = cairo_create(surface);
}
+2 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ namespace signaltk {

struct Layer {
  Layer();
  Layer(uint32_t width, uint32_t height);
  Layer(uint32_t width, uint32_t height, uint32_t dpi = 100);
  ~Layer();
  Layer(const Layer&) = delete;
  Layer& operator=(const Layer&) = delete;
@@ -32,6 +32,7 @@ struct Layer {

  uint32_t width;
  uint32_t height;
  uint32_t dpi;
  cairo_surface_t* surface;
  cairo_t* ctx;
};