Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Issue 164130: This CL adds client.toDataURL which gets the contents... (Closed)

Created:
11 years, 4 months ago by gman
Modified:
9 years, 7 months ago
Reviewers:
apatrick, piman
CC:
o3d-review_googlegroups.com
Visibility:
Public.

Description

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

Patch Set 1 #

Total comments: 13

Patch Set 2 : '' #

Patch Set 3 : '' #

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

Messages

Total messages: 5 (0 generated)
gman
11 years, 4 months ago (2009-08-07 03:37:15 UTC) #1
apatrick
Could you move the data url and png specific stuff out of the renderer? Maybe ...
11 years, 4 months ago (2009-08-07 18:25:45 UTC) #2
piman
http://codereview.chromium.org/164130/diff/1/13 File core/cross/bitmap_png.cc (right): http://codereview.chromium.org/164130/diff/1/13#newcode368 Line 368: if (setjmp(png_jmpbuf(png_ptr))) { On 2009/08/07 18:25:45, apatrick wrote: ...
11 years, 4 months ago (2009-08-07 19:04:32 UTC) #3
gman
http://codereview.chromium.org/164130/diff/1/13 File core/cross/bitmap_png.cc (right): http://codereview.chromium.org/164130/diff/1/13#newcode284 Line 284: // is implemented. On 2009/08/07 18:25:45, apatrick wrote: ...
11 years, 4 months ago (2009-08-07 21:34:31 UTC) #4
apatrick
11 years, 4 months ago (2009-08-07 23:15:17 UTC) #5
LGTM

Powered by Google App Engine
This is Rietveld 408576698