Last Comment Bug 697048 - Copy surface data URL's to clipboard
: Copy surface data URL's to clipboard
Status: RESOLVED FIXED
[inbound]
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla10
Assigned To: Matt Woodrow (:mattwoodrow)
:
: Milan Sreckovic [:milan]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-25 03:30 PDT by Matt Woodrow (:mattwoodrow)
Modified: 2011-10-26 17:08 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Copy data URL's to clipboard as well (1.37 KB, patch)
2011-10-25 03:30 PDT, Matt Woodrow (:mattwoodrow)
no flags Details | Diff | Splinter Review
Add multiple output formats for DumpAsDataURL (4.05 KB, patch)
2011-10-25 14:53 PDT, Matt Woodrow (:mattwoodrow)
roc: review+
Details | Diff | Splinter Review
Add multiple output formats for DumpAsDataURL v2 (8.88 KB, patch)
2011-10-25 18:45 PDT, Matt Woodrow (:mattwoodrow)
no flags Details | Diff | Splinter Review
Add multiple output formats for DumpAsDataURL v3 (8.85 KB, patch)
2011-10-25 20:05 PDT, Matt Woodrow (:mattwoodrow)
roc: review+
Details | Diff | Splinter Review

Description Matt Woodrow (:mattwoodrow) 2011-10-25 03:30:38 PDT
Created attachment 569321 [details] [diff] [review]
Copy data URL's to clipboard as well

Having these only dump to stdout can be hard to use, we should copy them to the clipboard as well.

It might be nice to have a way to specify where you want the output to go, not sure how to make this easy to use from a debugger though.

Maybe just multiple functions?
Comment 1 Matt Woodrow (:mattwoodrow) 2011-10-25 03:54:22 PDT
Comment on attachment 569321 [details] [diff] [review]
Copy data URL's to clipboard as well

Better patch coming.
Comment 2 Matt Woodrow (:mattwoodrow) 2011-10-25 14:53:05 PDT
Created attachment 569514 [details] [diff] [review]
Add multiple output formats for DumpAsDataURL
Comment 3 Matt Woodrow (:mattwoodrow) 2011-10-25 18:45:28 PDT
Created attachment 569578 [details] [diff] [review]
Add multiple output formats for DumpAsDataURL v2

Fixed a strlen bug, add gfxContext wrappers and made it fail less often by using GetAsImageSurface.
Comment 4 Robert O'Callahan (:roc) (email my personal email if necessary) 2011-10-25 19:08:11 PDT
Comment on attachment 569578 [details] [diff] [review]
Add multiple output formats for DumpAsDataURL v2

Review of attachment 569578 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/thebes/gfxASurface.cpp
@@ +853,5 @@
> +
> +  const char* prefix = "data:image/png;base64,";
> +  PRUint32 len = strlen(encodedImg) + strlen(prefix) + 1;
> +  char *fullString = new char[len];
> +  snprintf(fullString, len, "%s%s", prefix, encodedImg);

Why not use nsCString instead?
Comment 5 Matt Woodrow (:mattwoodrow) 2011-10-25 20:05:45 PDT
Created attachment 569595 [details] [diff] [review]
Add multiple output formats for DumpAsDataURL v3

Good point, C char arrays are horrible.
Comment 6 Matt Woodrow (:mattwoodrow) 2011-10-25 20:34:06 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/8d21cf5b59d0
Comment 7 Ed Morley [:emorley] 2011-10-26 17:08:11 PDT
https://hg.mozilla.org/mozilla-central/rev/8d21cf5b59d0

Note You need to log in before you can comment on or make changes to this bug.