From ef9f8d40c6af6ca531028d0a32051dbf0f88de2e Mon Sep 17 00:00:00 2001 From: John Beard Date: Thu, 30 Mar 2017 15:52:40 +0800 Subject: [PATCH] Init GAL class members (Coverity fixes) Fixes: CID 157139 (GAL) CID 157138 (CAIRO_GAL) --- common/gal/cairo/cairo_gal.cpp | 19 ++++++++++++++++--- common/gal/graphics_abstraction_layer.cpp | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/common/gal/cairo/cairo_gal.cpp b/common/gal/cairo/cairo_gal.cpp index 9026247503..0f08ada49c 100644 --- a/common/gal/cairo/cairo_gal.cpp +++ b/common/gal/cairo/cairo_gal.cpp @@ -52,11 +52,24 @@ CAIRO_GAL::CAIRO_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, mouseListener = aMouseListener; paintListener = aPaintListener; - // Initialize the flags + // Initialise grouping isGrouping = false; - isInitialized = false; - validCompositor = false; + isElementAdded = false; groupCounter = 0; + currentGroup = nullptr; + + // Initialise compositing state + mainBuffer = 0; + overlayBuffer = 0; + validCompositor = false; + SetTarget( TARGET_NONCACHED ); + + // Initialise Cairo state + cairo_matrix_init_identity( &cairoWorldScreenMatrix ); + currentContext = nullptr; + context = nullptr; + surface = nullptr; + isInitialized = false; // Connecting the event handlers Connect( wxEVT_PAINT, wxPaintEventHandler( CAIRO_GAL::onPaint ) ); diff --git a/common/gal/graphics_abstraction_layer.cpp b/common/gal/graphics_abstraction_layer.cpp index cf9ae16f60..24f6fe7e7f 100644 --- a/common/gal/graphics_abstraction_layer.cpp +++ b/common/gal/graphics_abstraction_layer.cpp @@ -55,6 +55,7 @@ GAL::GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions ) : SetFlip( false, false ); SetLineWidth( 1.0 ); computeWorldScale(); + SetAxesEnabled( false ); // Set grid defaults SetGridVisibility( true );