Author: Anton Gulenko <anton.gule...@googlemail.com> Branch: storage-display-refactoring Changeset: r939:e363f2952c1e Date: 2014-07-22 21:58 +0200 http://bitbucket.org/pypy/lang-smalltalk/changeset/e363f2952c1e/
Log: Cleanups. diff --git a/spyvm/display.py b/spyvm/display.py --- a/spyvm/display.py +++ b/spyvm/display.py @@ -74,11 +74,7 @@ self.bpp = rffi.getintfield(self.screen.c_format, 'c_BytesPerPixel') self.pitch = rffi.getintfield(self.screen, 'c_pitch') - def get_pixelbuffer_UCHAR(self): - # return jit.promote(rffi.cast(RSDL.Uint8P, self.screen.c_pixels)) - return jit.promote(self.screen.c_pixels) - - def get_pixelbuffer_UINT(self): + def get_pixelbuffer(self): return jit.promote(rffi.cast(RSDL.Uint32P, self.screen.c_pixels)) def defer_updates(self, flag): diff --git a/spyvm/model_display.py b/spyvm/model_display.py --- a/spyvm/model_display.py +++ b/spyvm/model_display.py @@ -61,14 +61,14 @@ # === Graphics - def pixelbuffer_UINT(self): - return self.display.get_pixelbuffer_UINT() + def pixelbuffer(self): + return self.display.get_pixelbuffer() def pixelbuffer_UCHAR(self): return self.display.get_pixelbuffer_UCHAR() def set_pixelbuffer_word(self, n, word): - self.pixelbuffer_UINT()[n] = word + self.pixelbuffer()[n] = word def take_over_display(self): # Make sure FrameWrapper.take_over_display() is called first for the correct Frame object. @@ -135,7 +135,7 @@ ((msb & mask) << 11) ) - self.pixelbuffer_UINT()[n] = r_uint(lsb | (msb << 16)) + self.pixelbuffer()[n] = r_uint(lsb | (msb << 16)) class W_8BitDisplayBitmap(W_DisplayBitmap): @@ -143,7 +143,7 @@ def set_pixelbuffer_word(self, n, word): # Invert the byte-order. - self.pixelbuffer_UINT()[n] = r_uint( + self.pixelbuffer()[n] = r_uint( (word >> 24) | ((word >> 8) & 0x0000ff00) | ((word << 8) & 0x00ff0000) | _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit