Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.100.mcz ==================== Summary ==================== Name: Graphics-nice.100 Author: nice Time: 18 January 2010, 9:55:15.04 pm UUID: 8b8a9718-7ce3-4885-82c8-9bfc5aab4fa9 Ancestors: Graphics-nice.99 move some temp assignment outside blocks =============== Diff against Graphics-nice.99 =============== Item was changed: ----- Method: Form>>displayInterpolatedIn:on: (in category 'displaying') ----- displayInterpolatedIn: aRectangle on: aForm "Display the receiver on aForm, using interpolation if necessary. Form fromUser displayInterpolatedOn: Display. Note: When scaling we attempt to use bilinear interpolation based on the 3D engine. If the engine is not there then we use WarpBlt. " | engine adjustedR | self extent = aRectangle extent ifTrue:[^self displayOn: aForm at: aRectangle origin]. + engine := Smalltalk at: #B3DRenderEngine + ifPresent: [:engineClass | (engineClass defaultForPlatformOn: aForm)]. - Smalltalk at: #B3DRenderEngine - ifPresent:[:engineClass| engine := (engineClass defaultForPlatformOn: aForm)]. engine ifNil:[ "We've got no bilinear interpolation. Use WarpBlt instead" (WarpBlt current toForm: aForm) sourceForm: self destRect: aRectangle; combinationRule: 3; cellSize: 2; warpBits. ^self ]. "Otherwise use the 3D engine for our purposes" "there seems to be a slight bug in B3D which the following adjusts for" adjustedR := (aRectangle withRight: aRectangle right + 1) translateBy: 0@1. engine viewport: adjustedR. engine material: ((Smalltalk at: #B3DMaterial) new emission: Color white). engine texture: self. engine render: ((Smalltalk at: #B3DIndexedQuadMesh) new plainTextureRect). engine finish.! Item was changed: ----- Method: Form>>displayInterpolatedOn: (in category 'displaying') ----- displayInterpolatedOn: aForm "Display the receiver on aForm, using interpolation if necessary. Form fromUser displayInterpolatedOn: Display. Note: When scaling we attempt to use bilinear interpolation based on the 3D engine. If the engine is not there then we use WarpBlt. " | engine | self extent = aForm extent ifTrue:[^self displayOn: aForm]. + engine := Smalltalk at: #B3DRenderEngine + ifPresent:[:engineClass| (engineClass defaultForPlatformOn: aForm)]. - Smalltalk at: #B3DRenderEngine - ifPresent:[:engineClass| engine := (engineClass defaultForPlatformOn: aForm)]. engine ifNil:[ "We've got no bilinear interpolation. Use WarpBlt instead" (WarpBlt current toForm: aForm) sourceForm: self destRect: aForm boundingBox; combinationRule: 3; cellSize: 2; warpBits. ^self ]. "Otherwise use the 3D engine for our purposes" engine viewport: aForm boundingBox. engine material: ((Smalltalk at: #B3DMaterial) new emission: Color white). engine texture: self. engine render: ((Smalltalk at: #B3DIndexedQuadMesh) new plainTextureRect). engine finish.! |
Free forum by Nabble | Edit this page |