Chromium Code Reviews
Help | Chromium Project | Sign in
(648)

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

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 8 months ago by gman
Modified:
2 years, 11 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) Lint Patch
M converter/cross/renderer_stub.h View 1 2 1 chunk +1 line, -1 line 0 comments 0 errors Download
M converter/cross/renderer_stub.cc View 1 2 1 chunk +2 lines, -3 lines 0 comments 0 errors Download
M core/cross/bitmap.h View 1 chunk +3 lines, -6 lines 0 comments 0 errors Download
M core/cross/bitmap.cc View 1 chunk +2 lines, -2 lines 0 comments 0 errors Download
M core/cross/bitmap_png.cc View 1 2 6 chunks +57 lines, -30 lines 0 comments 0 errors Download
M core/cross/client.h View 1 chunk +2 lines, -3 lines 0 comments 0 errors Download
M core/cross/client.cc View 1 2 2 chunks +9 lines, -3 lines 0 comments 0 errors Download
M core/cross/command_buffer/renderer_cb.h View 1 2 1 chunk +2 lines, -3 lines 0 comments 0 errors Download
M core/cross/command_buffer/renderer_cb.cc View 1 2 1 chunk +2 lines, -3 lines 0 comments 0 errors Download
M core/cross/gl/renderer_gl.h View 1 2 1 chunk +2 lines, -3 lines 0 comments 0 errors Download
M core/cross/gl/renderer_gl.cc View 1 2 2 chunks +2 lines, -14 lines 0 comments 0 errors Download
M core/cross/image_utils.h View 1 chunk +1 line, -2 lines 0 comments 0 errors Download
M core/cross/image_utils_test.cc View 1 chunk +2 lines, -4 lines 0 comments 0 errors Download
M core/cross/renderer.h View 1 2 1 chunk +2 lines, -3 lines 0 comments 0 errors Download
M core/win/d3d9/renderer_d3d9.h View 1 2 1 chunk +2 lines, -3 lines 0 comments 0 errors Download
M core/win/d3d9/renderer_d3d9.cc View 1 2 4 chunks +34 lines, -24 lines 0 comments 0 errors Download
M plugin/idl/client.idl View 2 chunks +20 lines, -4 lines 0 comments 0 errors Download
M tests/build.scons View 1 chunk +2 lines, -0 lines 0 comments 0 errors Download
M tests/selenium/selenium_utilities.py View 3 chunks +10 lines, -4 lines 0 comments 0 errors Download
M utils/build.scons View 1 chunk +2 lines, -0 lines 0 comments 0 errors Download
A utils/cross/base64.h View 1 chunk +56 lines, -0 lines 0 comments 0 errors Download
A utils/cross/base64.cc View 1 2 1 chunk +90 lines, -0 lines 0 comments 0 errors Download
A utils/cross/base64_test.cc View 1 2 1 chunk +65 lines, -0 lines 0 comments 0 errors Download
A utils/cross/dataurl.h View 1 2 1 chunk +52 lines, -0 lines 0 comments 0 errors Download
A utils/cross/dataurl.cc View 1 2 1 chunk +53 lines, -0 lines 0 comments 0 errors Download
A utils/cross/dataurl_test.cc View 1 chunk +56 lines, -0 lines 0 comments 0 errors Download
M utils/utils.gyp View 2 chunks +6 lines, -0 lines 0 comments 0 errors Download
Trybot results:
Commit:

Messages

Total messages: 5
gman
4 years, 8 months ago #1
apatrick
Could you move the data url and png specific stuff out of the renderer? Maybe ...
4 years, 8 months ago #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: ...
4 years, 8 months ago #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: ...
4 years, 8 months ago #4
apatrick
4 years, 8 months ago #5
LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1280:2d3e6564b7b6