Skip to content

Commit

Permalink
Revert "Fixed opaqueBackground and BitmapData texture fillRect."
Browse files Browse the repository at this point in the history
This reverts commit 347d721.
  • Loading branch information
charlesisfeline committed Nov 16, 2024
1 parent 606a37d commit ffe4235
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 33 deletions.
19 changes: 2 additions & 17 deletions src/openfl/display/BitmapData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ class BitmapData implements IBitmapDrawable
@:noCompletion private static var __textureInternalFormat:Int;
#if lime
@:noCompletion private static var __tempVector:Vector2 = new Vector2();
@:noCompletion private static var __fillRectRectangle:Rectangle = new Rectangle();
#end

/**
Expand Down Expand Up @@ -3205,24 +3204,10 @@ class BitmapData implements IBitmapDrawable

if (useScissor)
{
var x = Math.floor(rect.x);
var y = Math.floor(rect.y);
var width = (rect.width > 0 ? Math.ceil(rect.right) - x : 0);
var height = (rect.height > 0 ? Math.ceil(rect.bottom) - y : 0);
#if !openfl_dpi_aware
if (context.__backBufferWantsBestResolution)
{
x = Math.floor(rect.x / context.__stage.window.scale);
y = Math.floor(rect.y / context.__stage.window.scale);
width = (rect.width > 0 ? Math.ceil(rect.right / context.__stage.window.scale) - x : 0);
height = (rect.height > 0 ? Math.ceil(rect.bottom / context.__stage.window.scale) - y : 0);
__fillRectRectangle.setTo(x, y, width, height);
}
#end
context.setScissorRectangle(__fillRectRectangle);
context.setScissorRectangle(rect);
}

context.__clear(useScissor, color.r / 0xFF, color.g / 0xFF, color.b / 0xFF, transparent ? color.a / 0xFF : 1, 0, 0, Context3DClearMask.COLOR);
context.clear(color.r / 0xFF, color.g / 0xFF, color.b / 0xFF, transparent ? color.a / 0xFF : 1, 0, 0, Context3DClearMask.COLOR);

if (useScissor)
{
Expand Down
2 changes: 1 addition & 1 deletion src/openfl/display/_internal/Context3DDisplayObject.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Context3DDisplayObject

#if lime
var color:ARGB = (displayObject.opaqueBackground : ARGB);
context.__clear(true, color.r / 0xFF, color.g / 0xFF, color.b / 0xFF, 1, 0, 0, Context3DClearMask.COLOR);
context.clear(color.r / 0xFF, color.g / 0xFF, color.b / 0xFF, 1, 0, 0, Context3DClearMask.COLOR);
#end

renderer.__popMaskRect();
Expand Down
16 changes: 1 addition & 15 deletions src/openfl/display3D/Context3D.hx
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,6 @@ import lime.math.Vector2;
**/
public function clear(red:Float = 0, green:Float = 0, blue:Float = 0, alpha:Float = 1, depth:Float = 1, stencil:UInt = 0,
mask:UInt = Context3DClearMask.ALL):Void
{
__clear(false, red, green, blue, alpha, depth, stencil, mask);
}

@:noCompletion private function __clear(useScissor:Bool, red:Float = 0, green:Float = 0, blue:Float = 0, alpha:Float = 1, depth:Float = 1,
stencil:UInt = 0, mask:UInt = Context3DClearMask.ALL)
{
__flushGLFramebuffer();
__flushGLViewport();
Expand Down Expand Up @@ -525,15 +519,7 @@ import lime.math.Vector2;

if (clearMask == 0) return;

if (useScissor)
{
__flushGLScissor();
}
else
{
__setGLScissorTest(false);
}

__setGLScissorTest(false);
gl.clear(clearMask);
}

Expand Down

0 comments on commit ffe4235

Please sign in to comment.