The Inbox: Graphics-tfel.306.mcz

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

The Inbox: Graphics-tfel.306.mcz

commits-2
A new version of Graphics was added to project The Inbox:
http://source.squeak.org/inbox/Graphics-tfel.306.mcz

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

Name: Graphics-tfel.306
Author: tfel
Time: 12 February 2015, 4:30:55.231 pm
UUID: d29337c1-4ded-b541-bf1e-9a8ca326eb04
Ancestors: Graphics-kfr.305

get rid of the self>>error: call in BitBlt>>copyBits. This is not really useful, as we can just proceed and it still works. In addition, the RSqueakVM needs to go through this fallback code to run the BitBltSimulation (it doesn't have a plugin)

=============== Diff against Graphics-kfr.305 ===============

Item was changed:
  ----- Method: BitBlt>>copyBits (in category 'copying') -----
  copyBits
  "Primitive. Perform the movement of bits from the source form to the
  destination form. Fail if any variables are not of the right type (Integer,
  Float, or Form) or if the combination rule is not implemented.
  In addition to the original 16 combination rules, this BitBlt supports
  16 fail (to simulate paint)
  17 fail (to simulate mask)
  18 sourceWord + destinationWord
  19 sourceWord - destinationWord
  20 rgbAdd: sourceWord with: destinationWord
  21 rgbSub: sourceWord with: destinationWord
  22 rgbDiff: sourceWord with: destinationWord
  23 tallyIntoMap: destinationWord
  24 alphaBlend: sourceWord with: destinationWord
  25 pixPaint: sourceWord with: destinationWord
  26 pixMask: sourceWord with: destinationWord
  27 rgbMax: sourceWord with: destinationWord
  28 rgbMin: sourceWord with: destinationWord
  29 rgbMin: sourceWord bitInvert32 with: destinationWord
  "
  <primitive: 'primitiveCopyBits' module: 'BitBltPlugin'>
 
  "Check for compressed source, destination or halftone forms"
  (combinationRule >= 30 and: [combinationRule <= 31]) ifTrue:
  ["No alpha specified -- re-run with alpha = 1.0"
  ^ self copyBitsTranslucent: 255].
  ((sourceForm isForm) and: [sourceForm unhibernate])
  ifTrue: [^ self copyBits].
  ((destForm isForm) and: [destForm unhibernate])
  ifTrue: [^ self copyBits].
  ((halftoneForm isForm) and: [halftoneForm unhibernate])
  ifTrue: [^ self copyBits].
 
  "Check for unimplmented rules"
  combinationRule = Form oldPaint ifTrue: [^ self paintBits].
  combinationRule = Form oldErase1bitShape ifTrue: [^ self eraseBits].
 
  "Check if BitBlt doesn't support full color maps"
  (colorMap notNil and:[colorMap isColormap]) ifTrue:[
  colorMap := colorMap colors.
  ^self copyBits].
  "Check if clipping gots us way out of range"
  self clipRange ifTrue:[self roundVariables. ^self copyBitsAgain].
 
- self error: 'Bad BitBlt arg (Fraction?); proceed to convert.'.
  "Convert all numeric parameters to integers and try again."
  self roundVariables.
  ^ self copyBitsAgain!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Graphics-tfel.306.mcz

timfelgentreff
This is just a small change, but I wasn't sure if anyone can think of a reason for this line to be there. My reason for wanting it gone is that we, for RSqueakVM, do not include the BitBltPlugin, but instead run the simulator. The way we do it is that, when the image wants the RSqueakVM to run the copyBits primitive, we repeatedly fail (to let the fallback code unhibernate stuff and so on), and then, when the primitive is finally called from BitBlt>>copyBitsAgain, we instead call BitBlt>>copyBitsSimulated (so RSqueakVM requires the VMMaker to be loaded).

So, this error line would bring up the debugger, call BitBlt to draw it, bring up a debugger ....

Long story short, anyone have anything against removing this line?
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Graphics-tfel.306.mcz

Yoshiki Ohshima-3
On Thu, Feb 12, 2015 at 7:44 AM, timfelgentreff
<[hidden email]> wrote:

> This is just a small change, but I wasn't sure if anyone can think of a
> reason for this line to be there. My reason for wanting it gone is that we,
> for RSqueakVM, do not include the BitBltPlugin, but instead run the
> simulator. The way we do it is that, when the image wants the RSqueakVM to
> run the copyBits primitive, we repeatedly fail (to let the fallback code
> unhibernate stuff and so on), and then, when the primitive is finally called
> from BitBlt>>copyBitsAgain, we instead call BitBlt>>copyBitsSimulated (so
> RSqueakVM requires the VMMaker to be loaded).
>
> So, this error line would bring up the debugger, call BitBlt to draw it,
> bring up a debugger ....
>
> Long story short, anyone have anything against removing this line?

Ha.  The line used to be crucial to stay alive but I think it is
totally fine to remove it..


--
-- Yoshiki