def test_set_is_opaque(self): b = SkBitmap() for v in (True, False): b.setIsOpaque(v) self.assertEqual(b.isOpaque(), v)
def test_read_pixels(self): bitmap = SkBitmap() bitmap.setConfig(SkBitmap.kA8_Config, 1, 1) self.assertIsInstance(self.canvas.readPixels(bitmap, 0, 0), bool) self.assertIsInstance( self.canvas.readPixels( bitmap, 1, 1, SkCanvas.kNative_Premul_Config8888 ), bool )
def test_write_pixels(self): bitmap = SkBitmap() bitmap.setConfig(SkBitmap.kA8_Config, 1, 1) self.canvas.readPixels(bitmap, 0, 0) self.canvas.readPixels(bitmap, 1, 1, SkCanvas.kNative_Premul_Config8888)
def test_set_volatile(self): b = SkBitmap() self.assertFalse(b.isVolatile()) b.setIsVolatile(True) self.assertTrue(b.isVolatile())
def test_set_immutable(self): b = SkBitmap() self.assertFalse(b.isImmutable()) b.setImmutable() self.assertTrue(b.isImmutable())
def test_set_config(self): b = SkBitmap() b.setConfig(SkBitmap.kARGB_8888_Config, 1, 1) b.setConfig(SkBitmap.kARGB_8888_Config, 1, 1, 1)
def test_set_pixel_ref(self): b = SkBitmap() b.setPixelRef(SkPixelRef()) self.assertIsInstance(SkBitmap().pixelRef(), SkPixelRef)
def test_get_texture(self): b = SkBitmap() b.setConfig(SkBitmap.kA8_Config, 1, 1) self.assertIsInstance(b.getTexture(), SkGpuTexture)