Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chrome of two windows of same size,display bug #952

Closed
matrix3d opened this issue Mar 23, 2017 · 17 comments
Closed

chrome of two windows of same size,display bug #952

matrix3d opened this issue Mar 23, 2017 · 17 comments

Comments

@matrix3d
Copy link

http://ycanvas.yoz.sk/maps/

default

@matrix3d
Copy link
Author

not all frame display error.just some frame.

@JohnBlackburne
Copy link

I was not able to generate it when testing at the above link, but it looks like an error I had in my code with the ResizeEvent handler. I added code to handle such events, which goes through everything in the game and updates its size. But it was glitchy. If I resized the window it could easily end up in odd states with things not properly or consistently resized.

The problem was the engine was firing off ResizeEvents far faster than I could handle them, and they were colliding, perhaps interrupting each other or being handled out of order. The fix was to add a timer that switches off the handler for 60 frames/1 second each time an event is received, so the game has to deal with at most 1 such event per second.

That makes sense for me as the ResizeEvents only get called repeatedly now as I use it to ensure the game will work at a range of sizes – in the finished game it will only be called once at startup. For you it’s less obvious how often you should update it, but looking at e.g. Google Maps that seems to do it no more than once every second.

@matrix3d
Copy link
Author

@JohnBlackburne ,pls open 2 windows at the same time.and make they the same windows size.and easy get the bug.

@JohnBlackburne
Copy link

I tried three, and did not see that problem, though performance was noticeably worse. One of them did come up with no text in the sidebar, until I clicked on it, but after that was fine.

@matrix3d
Copy link
Author

spriteflexjs_flashdevelop

@blackjyn
Copy link

blackjyn commented Mar 24, 2017

When opened in 2 Windows they are glitchy and the CPU resource increasing drastically
Yes, they seems like "dancing" a bit , weird

@PrimaryFeather
Copy link
Contributor

PrimaryFeather commented Mar 27, 2017

I'm not sure what exactly I can do to help here. If the problem only appears in Chrome, it seems like a problem of the Stage3D implementation inside Chrome, or YCanvas relies on some specific Stage3D behaviour that works differently in Chrome (for whatever reason).

Either way, without pinning it down to an easier example, it's going to be really hard to get to the root of this. 😓

@matrix3d
Copy link
Author

matrix3d commented May 8, 2017

@PrimaryFeather you just put a stage3d image.and open 2 windows.and easy get this bug.

@coxfrederic
Copy link

Sure it is a Starling bug? Can you try to reproduce this using Stage3D without Starling?

@matrix3d
Copy link
Author

matrix3d commented May 8, 2017

@coxfrederic yes,it is a stage3d bug.
but some engine slove the bug,use some code.i do not knwo what code.

@themightyatom
Copy link

I dont' know if you solved this, but you could try with a non-gpu accelerated layer to catch your mouse clicks, to test, if nothing else. Should not affect performance if there's no blending going on.

@PrimaryFeather
Copy link
Contributor

Thanks for the updates! @matrix3d, you write that "some engine solves the bug" — do you know which one?

In any case, any Stage3D bugs are best reported by creating an issue on https://tracker.adobe.com, including an easy to run project that showcases the problem. Then post the link to the issue here, so we can vote for it.

We need to get this fixed inside Stage3D, on the long run.

@matrix3d
Copy link
Author

matrix3d commented May 11, 2017

package
{
    import flash.display.Sprite;
    import flash.events.Event;
    import starling.core.Starling;
    
    /**
     * ...
     * @author lizhi
     */
    public class Main extends Sprite 
    {
        
        public function Main() 
        {
            var s:Starling = new Starling(Game, stage);
            s.stage.color = 0xffffff;
            s.start();
        }
    }
}

import flash.display.BitmapData;
import starling.display.Image;
import starling.display.Sprite;
import starling.text.TextField;
import starling.text.TextFormat;
import starling.text.TextOptions;
import starling.textures.Texture;
/**
 * ...
 * @author lizhi
 */
class Game extends Sprite
{
    
    public function Game() 
    {
        var bmd:BitmapData = new BitmapData(32, 32);
        bmd.perlinNoise(100, 100, 1, 1, true, true);
        var texture:Texture = Texture.fromBitmapData(bmd);
        var texture2:Texture = Texture.fromBitmapData(bmd);
        var k:int = 0;
        for (var i:int = 0; i < 10;i++ ){
            for (var j:int = 0; j < 10;j++ ){
                var image:Image = new Image(k%2==0?texture:texture2);
                k++;
                addChild(image);
                image.x = i * bmd.width;
                image.y = j * bmd.height;
            }
        }
    }
    
}

@matrix3d
Copy link
Author

matrix3d commented Jun 5, 2017

hi,anyone get the bug?

@PrimaryFeather
Copy link
Contributor

Sorry, I somehow overlooked your previous post. Could you please explain in more detail what to do with that code you posted on May 11th? How did you set everything up to get an error?

@matrix3d
Copy link
Author

matrix3d commented Jun 5, 2017

@PrimaryFeather you just run my code.and open the index with chrome browser.
open 2 widnows,and easy get the error.

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title></title>
	<style>
		html, body{
		  height:100%; overflow:hidden; 
		}
		body { margin:0; }
	</style>
</head>
<body>
	<object type="application/x-shockwave-flash" data="starling.swf" width="400px" height="400px" id="altContent">
		<param name="wmode" value="direct" />
	</object>
</body>
</html>

@PrimaryFeather
Copy link
Contributor

With Chrome 72 and Flash Player 32, I can't reproduce the problem any longer – so this was probably fixed with an update of Chrome or its Flash plugin. Thus, I'm closing this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants