#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Mon, 25 Jul 2016 10:41:13 +0200
changeset 7467 b28e8bfab43d
parent 7466 f2b2fd93f05f
child 7468 6cc4f99397af
#REFACTORING by stefan class: GraphicsMedium added: #catchExpose #waitForExpose changed: #copyFrom:x:y:toX:y:width:height:async: catchExpose now returns true or false stating if #waitForExpose should be done
GraphicsMedium.st
--- a/GraphicsMedium.st	Mon Jul 25 10:40:28 2016 +0200
+++ b/GraphicsMedium.st	Mon Jul 25 10:41:13 2016 +0200
@@ -1374,7 +1374,7 @@
      (not all devices care for this).
      If the receiver is a pixmap, the call always returns immediately."
 
-    |deviceDrawable asy|
+    |deviceDrawable mustWait|
 
     ((aDrawable graphicsDevice ~~ device)
      or:[aDrawable isImage]) ifTrue:[
@@ -1382,12 +1382,12 @@
     ] ifFalse:[
         deviceDrawable := aDrawable
     ].
-    asy := async or:[aDrawable isForm or:[self isView not]].
-    asy ifFalse:[
-        self catchExpose
+    mustWait := async not and:[deviceDrawable isView and:[((deviceDrawable depth ~~ 1) or:[device depth == 1])]].
+    mustWait ifTrue:[
+        mustWait := self catchExpose.
     ].
     gc copyFrom:deviceDrawable graphicsContext x:srcX y:srcY toX:dstX y:dstY width:w height:h depth:self depth.
-    asy ifFalse:[
+    mustWait ifTrue:[
         self waitForExpose
     ]
 !
@@ -2311,6 +2311,20 @@
     gc xoring:aBlock
 ! !
 
+!GraphicsMedium methodsFor:'event handling'!
+
+catchExpose
+    "expose event handling is only required for views."
+
+    ^ false.
+!
+
+waitForExpose
+    "expose event handling is only required for views."
+
+    ^ self.
+! !
+
 !GraphicsMedium methodsFor:'filling'!
 
 black