Author: Lars Wassermann <[email protected]>
Branch: 
Changeset: r309:6b3637ecc396
Date: 2013-04-22 14:01 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/6b3637ecc396/

Log:    added 32bit bitblit form

diff --git a/spyvm/model.py b/spyvm/model.py
--- a/spyvm/model.py
+++ b/spyvm/model.py
@@ -757,13 +757,15 @@
 NATIVE_DEPTH = 32
 
 class W_DisplayBitmap(W_AbstractObjectWithClassReference):
-    _attrs_ = ['pixelbuffer', '_realsize', 'display']
+    _attrs_ = ['pixelbuffer', '_realsize', '_real_depth_buffer', 'display']
     _immutable_fields_ = ['_realsize', 'display']
 
     @staticmethod
     def create(space, w_class, size, depth, display):
         if depth == 1:
             return W_DisplayBitmap1Bit(space, w_class, size, depth, display)
+        elif depth == 32:
+            return W_DisplayBitmap32Bit(space, w_class, size, depth, display)
         else:
             raise NotImplementedError("non B/W squeak")
 
@@ -823,6 +825,14 @@
             mask >>= 1
             pos += 1
 
+class W_DisplayBitmap32Bit(W_DisplayBitmap):
+    def getword(self, n):
+        return self._real_depth_buffer[n]
+
+    @jit.unroll_safe
+    def setword(self, n, word):
+        self._real_depth_buffer[n] = word
+        self.pixelbuffer[n] = word
 
 # XXX Shouldn't compiledmethod have class reference for subclassed compiled
 # methods?
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to