From 85c4c1dd51c5f07caf7437ddb427cd7389cf5e3e Mon Sep 17 00:00:00 2001
From: H.G. Muller <h.g.muller@hccnet.nl>
Date: Fri, 5 Oct 2012 19:25:58 +0200
Subject: [PATCH] Cleanup CairoOverlayPiece

---
 backend.h |    1 +
 xboard.c  |    9 ---------
 2 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/backend.h b/backend.h
index 074ab98..d5cba54 100644
--- a/backend.h
+++ b/backend.h
@@ -289,6 +289,7 @@ typedef struct XB_ListGame {
     GameInfo gameInfo;      /*  Note that some entries may be NULL. */
 } ListGame;
 
+extern int doubleClick;
 extern int storedGames;
 extern int opponentKibitzes;
 extern ChessSquare gatingPiece;
diff --git a/xboard.c b/xboard.c
index 3153450..3d05f69 100644
--- a/xboard.c
+++ b/xboard.c
@@ -4148,16 +4148,7 @@ OverlayPiece (ChessSquare piece, GC clip, GC outline,  Drawable dest)
 static void
 CairoOverlayPiece (ChessSquare piece, cairo_surface_t *dest)
 {
-  static ChessSquare oldPiece = -1;
-  static int oldSize;
   static cairo_t *pieceSource;
-  extern int doubleClick; // in backend.c
-//  if(piece != oldPiece || squareSize != oldSize) { // try make it faster by only changing cr if we need other piece
-//    if(pieceSource) cairo_destroy (pieceSource);
-//    pieceSource = cairo_create (dest);
-//    cairo_set_source_surface (pieceSource, pngPieceBitmaps[!White(piece)][piece % BlackPawn], 0, 0);
-//    oldPiece = piece; oldSize = squareSize;
-//  }
   pieceSource = cairo_create (dest);
   cairo_set_source_surface (pieceSource, pngPieceBitmaps[!White(piece)][piece % BlackPawn], 0, 0);
   if(doubleClick) cairo_paint_with_alpha (pieceSource, 0.6);
-- 
1.7.0.4