The Trunk: Graphics-dtl.384.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Graphics-dtl.384.mcz

commits-2
David T. Lewis uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-dtl.384.mcz

==================== Summary ====================

Name: Graphics-dtl.384
Author: dtl
Time: 14 November 2017, 10:45:54.935133 pm
UUID: 09eeccf5-ae5f-45f7-91ae-72430a337370
Ancestors: Graphics-raa.383

Remove unnecessary references to global World.

=============== Diff against Graphics-raa.383 ===============

Item was changed:
  ----- Method: Form>>displayResourceFormOn: (in category 'displaying') -----
  displayResourceFormOn: aForm
  "a special display method for blowing up resource thumbnails"
  | engine tx cmap blitter |
  self extent = aForm extent ifTrue:[^self displayOn: aForm].
  engine := Smalltalk at: #B3DRenderEngine ifPresent:
  [:engineClass | engineClass defaultForPlatformOn: aForm].
  engine ifNil:[
  "We've got no bilinear interpolation. Use WarpBlt instead"
  (WarpBlt toForm: aForm)
  sourceForm: self destRect: aForm boundingBox;
  combinationRule: 3;
  cellSize: 2;
  warpBits.
  ^self
  ].
  tx := self asTexture.
  (blitter := BitBlt toForm: tx)
  sourceForm: self; destRect: aForm boundingBox;
  sourceOrigin: 0@0;
  combinationRule: Form paint.
  "map transparency to current World background color"
+ (Project current world color respondsTo: #pixelWordForDepth:) ifTrue: [
- (World color respondsTo: #pixelWordForDepth:) ifTrue: [
  cmap := Bitmap new: (self depth <= 8 ifTrue: [1 << self depth] ifFalse: [4096]).
+ cmap at: 1 put: (tx pixelWordFor: Project current world color).
- cmap at: 1 put: (tx pixelWordFor: World color).
  blitter colorMap: cmap.
  ].
  blitter copyBits.
  engine viewport: aForm boundingBox.
  engine material: ((Smalltalk at: #B3DMaterial) new emission: Color white).
  engine texture: tx.
  engine render: ((Smalltalk at: #B3DIndexedQuadMesh) new plainTextureRect).
  engine finish.
  "the above, using bilinear interpolation doesn't leave transparent pixel values intact"
  (WarpBlt toForm: aForm)
  sourceForm: self destRect: aForm boundingBox;
  combinationRule: Form and;
  colorMap: (Color maskingMap: self depth);
  warpBits.!

Item was changed:
  ----- Method: TextStyle class>>replaceFontsIn:with: (in category 'mime file in/out') -----
  replaceFontsIn: oldFontArray with: newStyle
  "
  TextStyle replaceFontsIn: (TextStyle looseFontsFromFamily: #Accuny) with: (TextStyle named: #Accuny)
  "
  "Try to find corresponding fonts in newStyle and substitute them for the fonts in oldFontArray"
 
  newStyle fontArray do: [ :newFont | newFont releaseCachedState ].
 
  oldFontArray do: [ :oldFont | | newFont |
  oldFont reset.
  newFont := (newStyle fontOfPointSize: oldFont pointSize) emphasis: oldFont emphasis.
  oldFont becomeForward: newFont ].
 
  Smalltalk at: #StringMorph ifPresent:[:cls| cls allSubInstancesDo: [ :s | s layoutChanged]].
  Smalltalk at: #TextMorph ifPresent:[:cls| cls allSubInstancesDo: [ :s | s layoutChanged]].
  Smalltalk at: #SystemWindow ifPresent:[:cls|
  cls allInstancesDo: [ :w | [ w update: #relabel ] on: Error do: [ :ex | ] ]].
+ Project current world ifNotNil: [ :w | w changed ].!
- World ifNotNil: [ :w | w changed ].!