|
This CL adds client.toDataURL which gets the contents
of the client area as a data url (which is a base64
encoded string of a png file)
data urls are part of the HTML5 standard and supported
by firefox, safari and chrome.
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-canvas-todataurl
That means you can now do this
var dataURL = client.toDataURL();
// make an IMG tag display the screenshot
someImgTag.src = dataURL;
// use the IMG tag to draw into a canvas
someCanvasContext.drawImage(someImageTag, ...);
It also means there is no need for the test builds
anymore "test-dbg-d3d", "test-opt-d3d" etc as
toDataURL is part of the public API and can
therefore always be used to take screenshots
in any build.
I updated the selenium code to use it.
There are a few issues:
1) The GL version has the same limitations as taking
a screenshot before. Namely that the client area
must be on screen. We need to fix this.
2) We need to add support for origin-clean. See
https://tracker.corp.google.com/story/show/180334
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=22869
Total comments: 13
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+537 lines, -115 lines) |
Patch |
 |
M |
converter/cross/renderer_stub.h
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
converter/cross/renderer_stub.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
core/cross/bitmap.h
|
View
|
|
1 chunk |
+3 lines, -6 lines |
0 comments
|
Download
|
 |
M |
core/cross/bitmap.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
core/cross/bitmap_png.cc
|
View
|
1
2
|
6 chunks |
+57 lines, -30 lines |
0 comments
|
Download
|
 |
M |
core/cross/client.h
|
View
|
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
core/cross/client.cc
|
View
|
1
2
|
2 chunks |
+9 lines, -3 lines |
0 comments
|
Download
|
 |
M |
core/cross/command_buffer/renderer_cb.h
|
View
|
1
2
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
core/cross/command_buffer/renderer_cb.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
core/cross/gl/renderer_gl.h
|
View
|
1
2
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
core/cross/gl/renderer_gl.cc
|
View
|
1
2
|
2 chunks |
+2 lines, -14 lines |
0 comments
|
Download
|
 |
M |
core/cross/image_utils.h
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
core/cross/image_utils_test.cc
|
View
|
|
1 chunk |
+2 lines, -4 lines |
0 comments
|
Download
|
 |
M |
core/cross/renderer.h
|
View
|
1
2
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
core/win/d3d9/renderer_d3d9.h
|
View
|
1
2
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
core/win/d3d9/renderer_d3d9.cc
|
View
|
1
2
|
4 chunks |
+34 lines, -24 lines |
0 comments
|
Download
|
 |
M |
plugin/idl/client.idl
|
View
|
|
2 chunks |
+20 lines, -4 lines |
0 comments
|
Download
|
 |
M |
tests/build.scons
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tests/selenium/selenium_utilities.py
|
View
|
|
3 chunks |
+10 lines, -4 lines |
0 comments
|
Download
|
 |
M |
utils/build.scons
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
A |
utils/cross/base64.h
|
View
|
|
1 chunk |
+56 lines, -0 lines |
0 comments
|
Download
|
 |
A |
utils/cross/base64.cc
|
View
|
1
2
|
1 chunk |
+90 lines, -0 lines |
0 comments
|
Download
|
 |
A |
utils/cross/base64_test.cc
|
View
|
1
2
|
1 chunk |
+65 lines, -0 lines |
0 comments
|
Download
|
 |
A |
utils/cross/dataurl.h
|
View
|
1
2
|
1 chunk |
+52 lines, -0 lines |
0 comments
|
Download
|
 |
A |
utils/cross/dataurl.cc
|
View
|
1
2
|
1 chunk |
+53 lines, -0 lines |
0 comments
|
Download
|
 |
A |
utils/cross/dataurl_test.cc
|
View
|
|
1 chunk |
+56 lines, -0 lines |
0 comments
|
Download
|
 |
M |
utils/utils.gyp
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
Total messages: 5 (0 generated)
|