-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
058e79f
commit f4a795b
Showing
5 changed files
with
10 additions
and
1,120 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
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
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 |
---|---|---|
|
@@ -6,11 +6,11 @@ | |
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
|
||
import { alpenglow, BoundedSubpath, ClippableFace, ClippableFaceAccumulator, DeviceContext, EdgedClippedFace, EdgedFace, EdgedFaceAccumulator, FaceConversion, getPolygonFilterGridBounds, getPolygonFilterGridOffset, getPolygonFilterWidth, HilbertMapping, IntegerEdge, LineIntersector, LineSplitter, OutputRaster, PolygonalFace, PolygonalFaceAccumulator, PolygonFilterType, PolygonMitchellNetravali, RasterClipper, RasterClipperOptions, RasterLog, RasterTileLog, RationalBoundary, RationalFace, RationalHalfEdge, RenderableFace, RenderColor, RenderEvaluationContext, RenderEvaluator, RenderExecutor, RenderPath, RenderPathBoolean, RenderPathReplacer, RenderProgram, RenderProgramNeeds } from '../imports.js'; | ||
import { alpenglow, BoundedSubpath, ClippableFace, ClippableFaceAccumulator, EdgedClippedFace, EdgedFace, EdgedFaceAccumulator, FaceConversion, getPolygonFilterGridBounds, getPolygonFilterGridOffset, getPolygonFilterWidth, HilbertMapping, IntegerEdge, LineIntersector, LineSplitter, OutputRaster, PolygonalFace, PolygonalFaceAccumulator, PolygonFilterType, PolygonMitchellNetravali, RasterLog, RasterTileLog, RationalBoundary, RationalFace, RationalHalfEdge, RenderableFace, RenderColor, RenderEvaluationContext, RenderEvaluator, RenderExecutor, RenderPath, RenderPathBoolean, RenderPathReplacer, RenderProgram, RenderProgramNeeds } from '../imports.js'; | ||
import Bounds2 from '../../../dot/js/Bounds2.js'; | ||
import Vector2 from '../../../dot/js/Vector2.js'; | ||
import Vector4 from '../../../dot/js/Vector4.js'; | ||
import { combineOptions, optionize3 } from '../../../phet-core/js/optionize.js'; | ||
import { optionize3 } from '../../../phet-core/js/optionize.js'; | ||
import Matrix3 from '../../../dot/js/Matrix3.js'; | ||
import Utils from '../../../dot/js/Utils.js'; | ||
|
||
|
@@ -52,8 +52,6 @@ export type RasterizationOptions = { | |
|
||
executionMethod?: RenderExecutionMethod; | ||
|
||
rasterClipperOptions?: RasterClipperOptions; | ||
|
||
log?: RasterLog | null; | ||
}; | ||
|
||
|
@@ -68,9 +66,6 @@ const DEFAULT_OPTIONS = { | |
renderableFaceMethod: 'traced', | ||
splitPrograms: true, | ||
executionMethod: 'instructions', | ||
rasterClipperOptions: { | ||
numStages: 16 | ||
}, | ||
log: null | ||
} as const; | ||
|
||
|
@@ -1214,29 +1209,6 @@ export default class Rasterize { | |
log && Rasterize.markEnd( 'rasterize-accumulate' ); | ||
} | ||
|
||
public static async hybridRasterize( | ||
renderProgram: RenderProgram, | ||
deviceContext: DeviceContext, | ||
canvasContext: GPUCanvasContext, | ||
bounds: Bounds2, | ||
// TODO: put colorSpace in options? Figure out how we're doing options | ||
colorSpace: 'srgb' | 'display-p3', | ||
providedOptions?: RasterizationOptions | ||
): Promise<void> { | ||
|
||
const options = optionize3<RasterizationOptions>()( {}, DEFAULT_OPTIONS, providedOptions ); | ||
|
||
const renderableFaces = Rasterize.partitionRenderableFaces( renderProgram, bounds, providedOptions ); | ||
|
||
const rasterClipper = RasterClipper.get( deviceContext ); | ||
|
||
const rasterClipperOptions = combineOptions<RasterClipperOptions>( { | ||
colorSpace: colorSpace | ||
}, options.rasterClipperOptions ); | ||
|
||
await rasterClipper.rasterize( renderableFaces, canvasContext.getCurrentTexture(), rasterClipperOptions ); | ||
} | ||
|
||
public static imageDataToCanvas( imageData: ImageData ): HTMLCanvasElement { | ||
const canvas = document.createElement( 'canvas' ); | ||
canvas.width = imageData.width; | ||
|
Oops, something went wrong.