-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
646 additions
and
580 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Class { | ||
#name : #BlBAbstractCircleCase, | ||
#superclass : #BlBAbstractTranslatingFiguresCase, | ||
#category : #'BlocBenchs-Benchs-Bloc' | ||
} | ||
|
||
{ #category : #running } | ||
BlBAbstractCircleCase class >> isAbstract [ | ||
|
||
^ self == BlBAbstractCircleCase | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractCircleCase >> newFigureWith: random [ | ||
|
||
^ BlElement new | ||
geometry: BlCircleGeometry new; | ||
size: self radius * 2; | ||
in:[ :me | self prepare: me with: random ]; | ||
yourself | ||
|
||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractCircleCase >> numberOfFigures [ | ||
|
||
^ 100 | ||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractCircleCase >> offsetBetweenFigures [ | ||
|
||
^ 6 @ 0 | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractCircleCase >> prepare: anElement with: random [ | ||
|
||
^ self subclassResponsibility | ||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractCircleCase >> radius [ | ||
|
||
^ 50.0 asPoint | ||
] |
68 changes: 68 additions & 0 deletions
68
src/BlocBenchs-Benchs/BlBAbstractGradientCirclesCase.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Class { | ||
#name : #BlBAbstractGradientCirclesCase, | ||
#superclass : #BlBAbstractCircleCase, | ||
#instVars : [ | ||
'numberOfStops' | ||
], | ||
#category : #'BlocBenchs-Benchs-Bloc' | ||
} | ||
|
||
{ #category : #running } | ||
BlBAbstractGradientCirclesCase class >> benchMatrix [ | ||
|
||
^ super benchMatrix | ||
forSelector: #numberOfStops addOptions: #(2 3 5) | ||
] | ||
|
||
{ #category : #running } | ||
BlBAbstractGradientCirclesCase class >> isAbstract [ | ||
|
||
^ self == BlBAbstractGradientCirclesCase | ||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractGradientCirclesCase >> defaultLabel [ | ||
|
||
^ '{1} w/ {2} stops' format: { | ||
super defaultLabel. | ||
numberOfStops } | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractGradientCirclesCase >> initialize [ | ||
|
||
super initialize. | ||
|
||
numberOfStops := 3. | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractGradientCirclesCase >> newGradient: random [ | ||
|
||
^ self subclassResponsibility | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractGradientCirclesCase >> newStops: random [ | ||
|
||
^ (0.0 to: 1.0 by: 1 / (numberOfStops - 1)) collect: [ :each | | ||
each -> (Color random: random) ] | ||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractGradientCirclesCase >> numberOfStops [ | ||
|
||
^ numberOfStops | ||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractGradientCirclesCase >> numberOfStops: anInteger [ | ||
|
||
numberOfStops := anInteger | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractGradientCirclesCase >> prepare: anElement with: random [ | ||
|
||
anElement background: (self newGradient: random) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Class { | ||
#name : #BlBAbstractImagesCase, | ||
#superclass : #BlBAbstractTranslatingFiguresCase, | ||
#traits : 'TBlBAbstractImagesLogic', | ||
#classTraits : 'TBlBAbstractImagesLogic classTrait', | ||
#category : #'BlocBenchs-Benchs-Bloc' | ||
} | ||
|
||
{ #category : #running } | ||
BlBAbstractImagesCase class >> isAbstract [ | ||
|
||
^ self == BlBAbstractImagesCase | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractImagesCase >> newFigureWith: random [ | ||
|
||
| container | | ||
container := BlElement new. | ||
container clipChildren: false. | ||
|
||
1 to: self numberOfRows do:[ :index | | ||
container addChild: | ||
((self newImageElementWith: random) | ||
position: 0 @ (index * self offsetBetweenFigures y); | ||
yourself) ]. | ||
|
||
^ container | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractImagesCase >> newImageElementWith: random [ | ||
|
||
^ self subclassResponsibility | ||
] |
133 changes: 133 additions & 0 deletions
133
src/BlocBenchs-Benchs/BlBAbstractTranslatingFiguresCase.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
Class { | ||
#name : #BlBAbstractTranslatingFiguresCase, | ||
#superclass : #BlBBlocCase, | ||
#instVars : [ | ||
'useSingleAnimation' | ||
], | ||
#category : #'BlocBenchs-Benchs-Bloc' | ||
} | ||
|
||
{ #category : #benchmarking } | ||
BlBAbstractTranslatingFiguresCase class >> benchMatrix [ | ||
|
||
^ super benchMatrix | ||
forSelector: #useSingleAnimation | ||
addOptions: #( true false ) | ||
] | ||
|
||
{ #category : #running } | ||
BlBAbstractTranslatingFiguresCase class >> isAbstract [ | ||
|
||
^ self == BlBAbstractTranslatingFiguresCase | ||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractTranslatingFiguresCase >> defaultLabel [ | ||
|
||
^ super defaultLabel , ' singleAnimation: ' , useSingleAnimation printString | ||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractTranslatingFiguresCase >> figureOffset [ | ||
|
||
^ 20 @ 20 | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractTranslatingFiguresCase >> newElement [ | ||
|
||
^ useSingleAnimation | ||
ifTrue: [ self newElementWithSingleAnimation ] | ||
ifFalse: [ self newElementWithIndependentAnimations ] | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractTranslatingFiguresCase >> newElementWithIndependentAnimations [ | ||
|
||
| random container | | ||
random := self newRandom. | ||
container := BlElement new | ||
size: self spaceExtent; | ||
yourself. | ||
|
||
1 to: self numberOfFigures do: [ :index | | ||
| aFigure | | ||
aFigure := self newFigureWith: random. | ||
aFigure position: self figureOffset + ((index * self offsetBetweenFigures x) @ 0). | ||
aFigure addAnimation: ((BlTransformAnimation translate: self targetTranslation) | ||
duration: self duration; | ||
yourself). | ||
|
||
container addChild: aFigure ]. | ||
|
||
^ container | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractTranslatingFiguresCase >> newElementWithSingleAnimation [ | ||
|
||
| random container | | ||
random := self newRandom. | ||
container := BlElement new | ||
size: self spaceExtent; | ||
addAnimation: ((BlTransformAnimation translate: self targetTranslation) | ||
duration: self duration; | ||
yourself); | ||
yourself. | ||
|
||
1 to: self numberOfFigures do: [ :index | | ||
| aFigure | | ||
aFigure := self newFigureWith: random. | ||
aFigure position: self figureOffset + ((index * self offsetBetweenFigures x) @ 0). | ||
container addChild: aFigure ]. | ||
|
||
^ container | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractTranslatingFiguresCase >> newFigureWith: random [ | ||
|
||
^ self subclassResponsibility | ||
] | ||
|
||
{ #category : #examples } | ||
BlBAbstractTranslatingFiguresCase >> newSampleFigure [ | ||
|
||
^ self newFigureWith: self newRandom | ||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractTranslatingFiguresCase >> numberOfFigures [ | ||
|
||
^ 300 | ||
] | ||
|
||
{ #category : #hook } | ||
BlBAbstractTranslatingFiguresCase >> offsetBetweenFigures [ | ||
|
||
^ 2 @ 0 | ||
] | ||
|
||
{ #category : #hooks } | ||
BlBAbstractTranslatingFiguresCase >> spaceExtent [ | ||
|
||
^ 750 @ 350 | ||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractTranslatingFiguresCase >> targetTranslation [ | ||
|
||
^ 0 @ 200 | ||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractTranslatingFiguresCase >> useSingleAnimation [ | ||
|
||
^ useSingleAnimation | ||
] | ||
|
||
{ #category : #accessing } | ||
BlBAbstractTranslatingFiguresCase >> useSingleAnimation: aBoolean [ | ||
|
||
useSingleAnimation := aBoolean | ||
] |
10 changes: 5 additions & 5 deletions
10
...chs-FPS/PCAnnulusSectorBenchCase.class.st → ...nchs-Benchs/BlBAnnulusSectorCase.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...chs-FPS/PCClippedImagesBenchCase.class.st → ...nchs-Benchs/BlBClippedImagesCase.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
...S/PCDashedBorderCirclesBenchCase.class.st → ...enchs/BlBDashedBorderCirclesCase.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/BlocBenchs-Benchs/BlBLinearGradientCirclesCase.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Class { | ||
#name : #BlBLinearGradientCirclesCase, | ||
#superclass : #BlBAbstractGradientCirclesCase, | ||
#category : #'BlocBenchs-Benchs-Bloc' | ||
} | ||
|
||
{ #category : #hook } | ||
BlBLinearGradientCirclesCase >> newGradient: random [ | ||
|
||
^ BlLinearGradientPaint new | ||
start: 0 asPoint; | ||
end: 2 * self radius; | ||
stops: (self newStops: random); | ||
yourself. | ||
] |
Oops, something went wrong.