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

test rendering/devtools project #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

henrikrudstrom
Copy link
Member

i created two new projects:
qmlbook/shorty a fork of qmlbook/shorty which is a simple screenshot utility. I modified it so you can specify a loader qml (which handles the actual screenshot creation) and a test qml to be rendered. (we should probably rename or merge it into qmlweb-dev)

qmlweb-dev is a project that can be cloned into the qmlweb main project. we can put optional dev stuff here. for now it contains the screenshot renderer.

just a proof of concept for now, but would like to hear your thoughts.

Clone and build:

in your qmlweb folder:
clone https://github.com/qmlweb/qmlweb-dev.git dev

cd dev

./build.sh

Render tests:

node dev/render.js

@@ -34,6 +34,8 @@
var ctx = canvas.getContext('2d');
canvas.height = img.height;
canvas.width = img.width;
ctx.fillStyle = "rgb(255,255,255)";
ctx.fillRect (0,0, canvas.width,canvas.width);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

canvas.width two times? Also, code style.
Should be ctx.fillRect(0, 0, canvas.width, canvas.height);.

@ChALkeR
Copy link
Member

ChALkeR commented Mar 3, 2016

This in fact does two things («integrate with qmlweb-dev» does not explain it good enough).

  1. Adds two more entries to .gitignore — this one looks unambiguous, LGTM on that.
  2. When comparing images in render tests, drops the opacity and compares them on the white background. Are we sure that we want that? I am viewing the transparency of the window as a feature that should be tested. If some tests do not want it — they could always paint the background using a rectangle.

@ChALkeR
Copy link
Member

ChALkeR commented Mar 3, 2016

Could you split that into two separate commits, btw?

@henrikrudstrom
Copy link
Member Author

will split.
The reason is that i changed the background was to match the output of the screenshot utility, could find out how to make that transparent, but afaik its not possible to make the browser window transparent, so everything would be renderend agains a background...

@henrikrudstrom henrikrudstrom force-pushed the devtools-integration branch 3 times, most recently from 3812753 to a650876 Compare March 3, 2016 14:54
@henrikrudstrom
Copy link
Member Author

rebased and moved screenshot background to separate commit
@ChALkeR @pavelvasev, @Plaristote LGTY?

@Plaristote
Copy link
Member

Shouldn't we use git submodules instead of a script ?

@ChALkeR
Copy link
Member

ChALkeR commented Jun 28, 2016

@Plaristote Yes, this should definitely use git submodules or a devdependency via npm — that depends on the purpose of the tools.

Note: I have not reviewed that repo yet, perhaps that should be done first before pulling this in here as a dependency.

@ChALkeR
Copy link
Member

ChALkeR commented Jun 28, 2016

@Plaristote I took a quick look at the repo, and that most probably should be transformed into a module that just provides the screenshot function.

See also #81.

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

Successfully merging this pull request may close these issues.

None yet

3 participants