diff --git a/packages/display/src/DisplayObjectContainer/usecase/DisplayObjectContainerGenerateRenderQueueUseCase.ts b/packages/display/src/DisplayObjectContainer/usecase/DisplayObjectContainerGenerateRenderQueueUseCase.ts index 1d74f07a..9b73607a 100644 --- a/packages/display/src/DisplayObjectContainer/usecase/DisplayObjectContainerGenerateRenderQueueUseCase.ts +++ b/packages/display/src/DisplayObjectContainer/usecase/DisplayObjectContainerGenerateRenderQueueUseCase.ts @@ -118,7 +118,6 @@ export const execute =
( } render_queue.push(child.placeId, child.clipDepth); - switch (true) { case child.isContainerEnabled: // 0x00 diff --git a/packages/display/src/Shape/usecase/ShapeBuildFromCharacterUseCase.ts b/packages/display/src/Shape/usecase/ShapeBuildFromCharacterUseCase.ts index 01f6e7b6..969f8cf4 100644 --- a/packages/display/src/Shape/usecase/ShapeBuildFromCharacterUseCase.ts +++ b/packages/display/src/Shape/usecase/ShapeBuildFromCharacterUseCase.ts @@ -27,25 +27,36 @@ export const execute = (shape: Shape, character: IShapeCharacter): void => graphics.yMin = character.bounds.yMin; graphics.yMax = character.bounds.yMax; - if (character.recodes) { - - switch (true) { - - // todo - - default: - if (!character.recodeBuffer) { - character.recodeBuffer = new Float32Array( - graphicsToNumberArrayService(width, height, character.recodes) - ); - $poolArray(character.recodes); - character.recodes = null; - } - graphics.buffer = character.recodeBuffer.slice(0); - break; - - } - } else { - // todo + switch (true) { + + case character.bitmapId > 0: + break; + + case character.inBitmap: + break; + + default: + switch (true) { + + // todo + + default: + if (character.recodes) { + character.recodeBuffer = new Float32Array( + graphicsToNumberArrayService(width, height, character.recodes) + ); + $poolArray(character.recodes); + character.recodes = null; + } + + if (!character.recodeBuffer) { + break; + } + + graphics.buffer = character.recodeBuffer.slice(0); + break; + + } + break; } }; \ No newline at end of file diff --git a/packages/display/src/Shape/usecase/ShapeGenerateRenderQueueUseCase.ts b/packages/display/src/Shape/usecase/ShapeGenerateRenderQueueUseCase.ts index c1373b2a..7afa8274 100644 --- a/packages/display/src/Shape/usecase/ShapeGenerateRenderQueueUseCase.ts +++ b/packages/display/src/Shape/usecase/ShapeGenerateRenderQueueUseCase.ts @@ -37,7 +37,6 @@ export const execute = ( ): void => { render_queue.push($RENDERER_SHAPE_TYPE); - if (!shape.visible) { render_queue.push(0); return ; @@ -203,8 +202,8 @@ export const execute = ( const cacheKey = shape.cacheKey; render_queue.push(cacheKey); - const cachePosition = $cacheStore.get(shape.uniqueKey, `${cacheKey}`); - if (!cachePosition) { + const cache = $cacheStore.get(shape.uniqueKey, `${cacheKey}`); + if (!cache) { render_queue.push(0); const buffer = graphics.buffer; diff --git a/packages/renderer/src/Command/usecase/CommandRenderUseCase.ts b/packages/renderer/src/Command/usecase/CommandRenderUseCase.ts index e4b1d56c..b2007663 100644 --- a/packages/renderer/src/Command/usecase/CommandRenderUseCase.ts +++ b/packages/renderer/src/Command/usecase/CommandRenderUseCase.ts @@ -85,4 +85,5 @@ export const execute = (render_queue: Float32Array): void => $context.drawArraysInstanced(); $context.transferMainCanvas(); + // $context.debug(); }; \ No newline at end of file diff --git a/packages/renderer/src/Shape/service/ShapeCommandService.ts b/packages/renderer/src/Shape/service/ShapeCommandService.ts index 54b42bda..d2ac7927 100644 --- a/packages/renderer/src/Shape/service/ShapeCommandService.ts +++ b/packages/renderer/src/Shape/service/ShapeCommandService.ts @@ -91,18 +91,22 @@ export const execute = (commands: Float32Array, has_grid: boolean): void => break; case GRADIENT_FILL: + console.log("GRADIENT_FILL"); // todo break; case GRADIENT_STROKE: + console.log("GRADIENT_STROKE"); // todo break; case BITMAP_FILL: + console.log("BITMAP_FILL"); // todo break; case BITMAP_STROKE: + console.log("BITMAP_STROKE"); // todo break; diff --git a/packages/renderer/src/Shape/usecase/ShapeRenderUseCase.ts b/packages/renderer/src/Shape/usecase/ShapeRenderUseCase.ts index 064b206c..6417a611 100644 --- a/packages/renderer/src/Shape/usecase/ShapeRenderUseCase.ts +++ b/packages/renderer/src/Shape/usecase/ShapeRenderUseCase.ts @@ -82,7 +82,8 @@ export const execute = (render_queue: Float32Array, index: number): number => const height = Math.ceil(Math.abs(yMax - yMin) * yScale); node = $context.createNode(width, height); - + $cacheStore.set(uniqueKey, `${cacheKey}`, node); + // 初期化して、描画範囲とmatrix設定 $context.reset(); $context.beginNodeRendering(node); @@ -111,7 +112,6 @@ export const execute = (render_queue: Float32Array, index: number): number => if (!node) { return index; } - } const radianX = Math.atan2(matrix[1], matrix[0]); diff --git a/packages/webgl/src/Context.ts b/packages/webgl/src/Context.ts index c24f0133..8ba6eeeb 100644 --- a/packages/webgl/src/Context.ts +++ b/packages/webgl/src/Context.ts @@ -30,6 +30,7 @@ import { execute as blnedDrawArraysInstancedUseCase } from "./Blend/usecase/Blne import { execute as vertexArrayObjectBootUseCase } from "./VertexArrayObject/usecase/VertexArrayObjectBootUseCase"; import { execute as frameBufferManagerTransferMainCanvasService } from "./FrameBufferManager/service/FrameBufferManagerTransferMainCanvasService"; import { execute as blendEnableUseCase } from "./Blend/usecase/BlendEnableUseCase"; +import { execute as contextDebugService } from "./Context/service/ContextDebugService"; import { $getAtlasAttachmentObject } from "./AtlasManager"; import { $setReadFrameBuffer, @@ -702,4 +703,9 @@ export class Context { frameBufferManagerTransferMainCanvasService(); } + + debug (): void + { + contextDebugService(); + } } \ No newline at end of file diff --git a/packages/webgl/src/Context/service/ContextDebugService.ts b/packages/webgl/src/Context/service/ContextDebugService.ts new file mode 100644 index 00000000..c04a5565 --- /dev/null +++ b/packages/webgl/src/Context/service/ContextDebugService.ts @@ -0,0 +1,36 @@ +import { $drawFrameBuffer } from "../../FrameBufferManager"; +import { $context, $gl } from "../../WebGLUtil"; + +export const execute = (): void => +{ + const currentAttachmentObject = $context.currentAttachmentObject; + $context.bind($context.atlasAttachmentObject); + + const width = $context.$mainAttachmentObject?.width; + const height = $context.$mainAttachmentObject?.height; + + // use main Framebuffer + $gl.bindFramebuffer( + $gl.DRAW_FRAMEBUFFER, + null + ); + + // execute + $gl.blitFramebuffer( + 0, 0, $context.atlasAttachmentObject?.width, $context.atlasAttachmentObject?.height, + 0, 0, width, height, + $gl.COLOR_BUFFER_BIT, + $gl.NEAREST + ); + + // reset + $gl.bindFramebuffer( + $gl.DRAW_FRAMEBUFFER, + $drawFrameBuffer + ); + + if (currentAttachmentObject) { + $context.bind(currentAttachmentObject); + } + +}; \ No newline at end of file