Don't count resolution time in the benchmark.

This means that users of Pathfinder will have to accept floating point
textures in order to get the advertised performance, but as they're well
supported on all modern GPUs I don't consider that much of a problem.
This commit is contained in:
Patrick Walton 2017-09-26 13:34:40 -07:00
parent 6b0c215148
commit 70ab2d55f3
4 changed files with 16 additions and 3 deletions

View File

@ -36,7 +36,12 @@ export abstract class AntialiasingStrategy {
// Called after direct rendering.
//
// This usually performs the actual antialiasing and blits to the real framebuffer.
// This usually performs the actual antialiasing.
abstract antialias(view: PathfinderDemoView): void;
// Called after antialiasing.
//
// This usually blits to the real framebuffer.
abstract resolve(view: PathfinderDemoView): void;
// True if direct rendering should occur.
@ -65,6 +70,8 @@ export class NoAAStrategy extends AntialiasingStrategy {
view.gl.disable(view.gl.SCISSOR_TEST);
}
antialias(view: PathfinderDemoView) {}
resolve(view: PathfinderDemoView) {}
get shouldRenderDirect() {

View File

@ -262,7 +262,7 @@ export abstract class ECAAStrategy extends AntialiasingStrategy {
]);
}
resolve(view: MonochromePathfinderView) {
antialias(view: MonochromePathfinderView) {
// Detect edges if necessary.
this.detectEdgesIfNecessary(view);
@ -272,7 +272,9 @@ export abstract class ECAAStrategy extends AntialiasingStrategy {
// Antialias.
this.antialiasLines(view);
this.antialiasCurves(view);
}
resolve(view: MonochromePathfinderView) {
// Resolve the antialiasing.
this.resolveAA(view);
}

View File

@ -77,6 +77,8 @@ export default class SSAAStrategy extends AntialiasingStrategy {
view.gl.enable(view.gl.SCISSOR_TEST);
}
antialias(view: PathfinderDemoView) {}
resolve(view: PathfinderDemoView) {
view.gl.bindFramebuffer(view.gl.FRAMEBUFFER, view.destFramebuffer);
view.gl.viewport(0, 0, view.destAllocatedSize[0], view.destAllocatedSize[1]);

View File

@ -280,7 +280,7 @@ export abstract class PathfinderDemoView extends PathfinderView {
this.renderDirect();
// Antialias.
antialiasingStrategy.resolve(this);
antialiasingStrategy.antialias(this);
// End the timer, and start a new one.
if (this.timerQueryPollInterval == null) {
@ -289,6 +289,8 @@ export abstract class PathfinderDemoView extends PathfinderView {
this.compositingTimerQuery);
}
antialiasingStrategy.resolve(this);
// Draw the glyphs with the resolved atlas to the default framebuffer.
this.compositeIfNecessary();