Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion core/base/inc/TCanvasImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "Rtypes.h"

class TCanvas;

class TVirtualPadPainter;

class TCanvasImp {
friend class TCanvas;
Expand All @@ -42,6 +42,9 @@ friend class TCanvas;
virtual void Unlock() { }
virtual Bool_t IsLocked() { return kFALSE; }

virtual Bool_t PerformUpdate() { return kFALSE; }
virtual TVirtualPadPainter *CreatePadPainter() { return 0; }

public:
TCanvasImp(TCanvas *c=0) : fCanvas(c) { }
TCanvasImp(TCanvas *c, const char *name, UInt_t width, UInt_t height);
Expand Down
20 changes: 12 additions & 8 deletions graf2d/gpad/src/TCanvas.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2249,14 +2249,17 @@ void TCanvas::Update()

fUpdating = kTRUE;

if (!IsBatch()) FeedbackMode(kFALSE); // Goto double buffer mode
if (!fCanvasImp->PerformUpdate()) {

if (!UseGL())
PaintModified(); // Repaint all modified pad's
if (!IsBatch()) FeedbackMode(kFALSE); // Goto double buffer mode

Flush(); // Copy all pad pixmaps to the screen
if (!UseGL()) PaintModified(); // Repaint all modified pad's

Flush(); // Copy all pad pixmaps to the screen

SetCursor(kCross);
}

SetCursor(kCross);
fUpdating = kFALSE;
}

Expand Down Expand Up @@ -2299,9 +2302,10 @@ void TCanvas::CreatePainter()
{
//Even for batch mode painter is still required, just to delegate
//some calls to batch "virtual X".
if (!UseGL() || fBatch)
fPainter = new TPadPainter;//Do not need plugin manager for this!
else {
if (!UseGL() || fBatch) {
fPainter = !fCanvasImp ? 0 : fCanvasImp->CreatePadPainter();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is

if (fCanvasImp)
  fPainter = fCanvasImp->CreatePadPainter();

maybe a more readable version of this code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a more readable version of this code?

Done

if (!fPainter) fPainter = new TPadPainter; // Do not need plugin manager for this!
} else {
fPainter = TVirtualPadPainter::PadPainter("gl");
if (!fPainter) {
Error("CreatePainter", "GL Painter creation failed! Will use default!");
Expand Down