Commit Graph

267 Commits

Author SHA1 Message Date
halcanary
a2e056773d Revert of default SkPixelSerializer (patchset #2 id:20001 of https://codereview.chromium.org/1507123002/ )
Reason for revert:
I was overconfident.

Original issue's description:
> default SkPixelSerializer
>
> Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.
>
> Add SkImageEncoder::CreatePixelSerializer() to return a
> PixelSerializer that calls into SkImageEncoder::EncodeData.
>
> SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.
>
> Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b
>
> Committed: https://skia.googlesource.com/skia/+/808ce2886d732b1055f89c8fb0f1b11b47fcb0ce

TBR=reed@google.com,scroggo@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1511183002
2015-12-09 03:56:02 -08:00
halcanary
808ce2886d default SkPixelSerializer
Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.

Add SkImageEncoder::CreatePixelSerializer() to return a
PixelSerializer that calls into SkImageEncoder::EncodeData.

SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.

Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b

Review URL: https://codereview.chromium.org/1507123002
2015-12-08 19:02:36 -08:00
reed
290f00cd75 Revert of default SkPixelSerializer (patchset #1 id:1 of https://codereview.chromium.org/1507123002/ )
Reason for revert:
Breaking DEPS roll (linker error)

Original issue's description:
> default SkPixelSerializer
>
> Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.
>
> Add SkImageEncoder::CreatePixelSerializer() to return a
> PixelSerializer that calls into SkImageEncoder::EncodeData.
>
> SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.
>
> Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b

TBR=scroggo@google.com,halcanary@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1505203003
2015-12-08 10:59:13 -08:00
halcanary
b0bd1516bf default SkPixelSerializer
Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.

Add SkImageEncoder::CreatePixelSerializer() to return a
PixelSerializer that calls into SkImageEncoder::EncodeData.

SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.

Review URL: https://codereview.chromium.org/1507123002
2015-12-08 10:29:58 -08:00
djsollen
a745186c93 Update debugger UI to auto-refresh the directory listing
Review URL: https://codereview.chromium.org/1462633002
2015-11-18 13:00:21 -08:00
mtklein
835c1b69a2 Clean up dead code: PictureRenderer
Doesn't appear to actually be used by anything.

BUG=skia:

Review URL: https://codereview.chromium.org/1457753002
2015-11-18 09:41:06 -08:00
fmalita
3f0424ff57 [SkDebugger] Remove unneeded SkDebuggerGUI includes
R=robertphillips@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1411963006
2015-11-02 09:32:54 -08:00
robertphillips
87ed6be0e4 Get debugger compiling again
Recent house cleaning has broken the debugger - mainly around the defunct profiling feature. This makes CL it even more defunct.

Review URL: https://codereview.chromium.org/1416723006
2015-10-26 09:28:12 -07:00
mtklein
fe81e2d274 Make SkGraphics::Term a no-op, stop calling it.
I'd remove it entirely but Android is calling it explicitly.

BUG=skia:4259

Committed: https://skia.googlesource.com/skia/+/925979f733fe8e70d84627147dee04d030423349

Review URL: https://codereview.chromium.org/1329853005
2015-09-09 07:35:42 -07:00
mtklein
d9b8d7ac1f Revert of Make SkGraphics::Term a no-op, stop calling it. (patchset #2 id:20001 of https://codereview.chromium.org/1329853005/ )
Reason for revert:
SK_ATTR_DEPRECATED is meaningful to Android.  Don't use it.

Original issue's description:
> Make SkGraphics::Term a no-op, stop calling it.
>
> I'd remove it entirely but Android is calling it explicitly.
>
> BUG=skia:4259
>
> Committed: https://skia.googlesource.com/skia/+/925979f733fe8e70d84627147dee04d030423349

TBR=reed@google.com,scroggo@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4259

Review URL: https://codereview.chromium.org/1314483006
2015-09-09 07:22:09 -07:00
mtklein
925979f733 Make SkGraphics::Term a no-op, stop calling it.
I'd remove it entirely but Android is calling it explicitly.

BUG=skia:4259

Review URL: https://codereview.chromium.org/1329853005
2015-09-08 15:18:21 -07:00
halcanary
96fcdcc219 Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
2015-08-27 07:41:16 -07:00
halcanary
385fe4d4b6 Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003

Review URL: https://codereview.chromium.org/1316123003
2015-08-26 13:07:49 -07:00
bungeman
76bb228106 Fix no-gpu debugger.
Review URL: https://codereview.chromium.org/1262723005
2015-07-31 15:46:03 -07:00
robertphillips
52d4deb128 Fix debugger compilation
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1205933002
2015-06-24 10:09:57 -07:00
fmalita
109a23d64f Remove the SkCanvas comment API
No longer used in Chromium/Blink.

R=reed@google.com,robertphillips@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1153593003
2015-06-15 13:15:31 -07:00
robertphillips
4e11c0b54d Get debugger compiling again
Review URL: https://codereview.chromium.org/1125543003
2015-05-04 10:42:05 -07:00
fmalita
160ebb2bfa [SkDebugger] Flatten drawPicture ops
Add two drawPicture bracketing ops (BeginDrawPicture, EndDrawPicture) to
replace the current DrawPicture op, and flatten picture contents.

Review URL: https://codereview.chromium.org/1048383002
2015-04-01 20:58:37 -07:00
robertphillips
546db46a76 Debugger: remove dead feature (SkPicture offset display) & fix bug (unbalanced indents)
Displaying the offset into an SkPicture hasn't worked for a while so this CL deletes the feature.
When "Save Layer" was renamed to "SaveLayer" the code that computes the indent in the list view was broken. This CL patches the problem.

Review URL: https://codereview.chromium.org/1034733004
2015-03-26 10:08:04 -07:00
robertphillips
3e5c2b1041 Preserve texture compression when saving a revised skp from debugger
Without this CL, saving a revised skp out the debugger can greatly expand the memory it requires.

Review URL: https://codereview.chromium.org/1020103005
2015-03-23 05:46:51 -07:00
reed
e7903c7397 FilterLevel -> SkFilterQuality
BUG=skia:
TBR=
NOTREECHECKS=True
NOTRY=True

Review URL: https://codereview.chromium.org/1010023002
2015-03-16 10:26:13 -07:00
reed
93a1215fe0 SkPaint::FilterLevel -> SkFilterQuality
clone (+rebase) of https://codereview.chromium.org/1009183002/

BUG=skia:
TBR=scroggo@google.com

Review URL: https://codereview.chromium.org/1014533004
2015-03-16 10:08:34 -07:00
robertphillips
9bafc30c79 Remove SkPictureFlat.h include from SkDrawCommands.h
This cannot land until https://codereview.chromium.org/909353004/ (Prepare SkiaBenchmarkingExtensionTest for upcoming Skia changes) lands in Chromium

Committed: https://skia.googlesource.com/skia/+/5a4c233a3657d12d836de388b41e30405b4ab976

Committed: https://skia.googlesource.com/skia/+/fa3a83d0fe53907e618346d3f1c17a95da1a9d22

Review URL: https://codereview.chromium.org/912403004
2015-02-13 11:13:00 -08:00
robertphillips
3a092042bc Revert of Remove SkPictureFlat.h include from SkDrawCommands.h (patchset #3 id:40001 of https://codereview.chromium.org/912403004/)
Reason for revert:
Erm - Chrome.

Original issue's description:
> Remove SkPictureFlat.h include from SkDrawCommands.h
>
> This cannot land until https://codereview.chromium.org/909353004/ (Prepare SkiaBenchmarkingExtensionTest for upcoming Skia changes) lands in Chromium
>
> Committed: https://skia.googlesource.com/skia/+/5a4c233a3657d12d836de388b41e30405b4ab976
>
> Committed: https://skia.googlesource.com/skia/+/fa3a83d0fe53907e618346d3f1c17a95da1a9d22

TBR=reed@google.com,fmalita@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/923753002
2015-02-12 13:29:15 -08:00
robertphillips
fa3a83d0fe Remove SkPictureFlat.h include from SkDrawCommands.h
This cannot land until https://codereview.chromium.org/909353004/ (Prepare SkiaBenchmarkingExtensionTest for upcoming Skia changes) lands in Chromium

Committed: https://skia.googlesource.com/skia/+/5a4c233a3657d12d836de388b41e30405b4ab976

Review URL: https://codereview.chromium.org/912403004
2015-02-12 12:30:42 -08:00
robertphillips
2de5939115 Revert of Fix Chromium build (patchset #2 id:20001 of https://codereview.chromium.org/916763003/)
Reason for revert:
Chrome

Original issue's description:
> Fix Chromium build
>
> TBR=jvanverth@google.com
>
> Committed: https://skia.googlesource.com/skia/+/f5e89c8f685ac8a5c4d117e087b4111d613106db

TBR=jvanverth@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/916963002
2015-02-11 13:18:14 -08:00
robertphillips
2e6024248f Revert of Remove SkPictureFlat.h include from SkDrawCommands.h (patchset #2 id:20001 of https://codereview.chromium.org/912403004/)
Reason for revert:
Chrome

Original issue's description:
> Remove SkPictureFlat.h include from SkDrawCommands.h
>
> Committed: https://skia.googlesource.com/skia/+/5a4c233a3657d12d836de388b41e30405b4ab976

TBR=reed@google.com,fmalita@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/917933002
2015-02-11 13:07:13 -08:00
robertphillips
f5e89c8f68 Fix Chromium build
TBR=jvanverth@google.com

Review URL: https://codereview.chromium.org/916763003
2015-02-11 11:38:44 -08:00
robertphillips
5a4c233a36 Remove SkPictureFlat.h include from SkDrawCommands.h
Review URL: https://codereview.chromium.org/912403004
2015-02-11 10:27:30 -08:00
kkinnunen
9e33d1dbcc debugger: Abandon context when Qt changes it without notice
Qt changes the context on many conditions. Abandon GrContext
in these cases.

Also call GrContext::resetContext during Qt GL paint callback,
the GL state may be touched by Qt.

Fixes the bug where changing between gpu and msaa would start
erroring in framebuffer binds, if the .skp had many layers.

Review URL: https://codereview.chromium.org/915573002
2015-02-10 22:27:48 -08:00
scroggo
a1193e4b0e Make SkStream *not* ref counted.
SkStream is a stateful object, so it does not make sense for it to have
multiple owners. Make SkStream inherit directly from SkNoncopyable.

Update methods which previously called SkStream::ref() (e.g.
SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(),
which required the existing owners to call SkStream::unref()) to take
ownership of their SkStream parameters and delete when done (including
on failure).

Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some
cases this means heap allocating streams that were previously stack
allocated.

Respect ownership rules of SkTypeface::CreateFromStream() and
SkImageDecoder::buildTileIndex().

Update the comments for exceptional methods which do not affect the
ownership of their SkStream parameters (e.g.
SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be
explicit about ownership.

Remove test_stream_life, which tested that buildTileIndex() behaved
correctly when SkStream was a ref counted object. The test does not
make sense now that it is not.

In SkPDFStream, remove the SkMemoryStream member. Instead of using it,
create a new SkMemoryStream to pass to fDataStream (which is now an
SkAutoTDelete).

Make other pdf rasterizers behave like SkPDFDocumentToBitmap.

SkPDFDocumentToBitmap delete the SkStream, so do the same in the
following pdf rasterizers:

SkPopplerRasterizePDF
SkNativeRasterizePDF
SkNoRasterizePDF

Requires a change to Android, which currently treats SkStreams as ref
counted objects.

Review URL: https://codereview.chromium.org/849103004
2015-01-21 12:09:53 -08:00
Brian Salomon
a2d9478e92 Fix debugger wrt to new SkGpuDevice factory signature'
Review URL: https://codereview.chromium.org/855083003
2015-01-16 14:01:44 -05:00
kkinnunen
26a00de4f3 Remove incremental draw optimization from SkDebugCanvas
The SkDebugCanvas can be (or is currently) being used to draw to multiple
different canvases. If this use-case is intended, then storing draw
-related state in the canvas causes bugs.

Remove incremental draw from SkDebugCanvas. It can only optimize the
case where draw command index is advanced, no other changes are done
and no visualization is used. This case is not that critical, as it
happens only once per new frame at most. It causes bugs, because
one SkDebugCanvas is used to draw to multiple canvases.

Leave the draw to canvas in same state as it was passed in.

This fixes the debugger bugs where:
 * Old, stale image would stay on the raster canvas when a new image is
 loaded. Also happened with resizes.

 * Proper image for overdraw filter would be visible only for the first
   frame

Review URL: https://codereview.chromium.org/844493003
2015-01-13 23:09:19 -08:00
kkinnunen
cfdc0e3fee debugger: SW rasterize the picture only when it changes
Rasterize the picture only when it changes, not every time
raster widget paints itself.

Removes include SkForceLinking.h while organizing the SkDebuggerGUI.cpp
includes.

This is part of the work trying to remove bugs that come from
SkDebugCanvas stateful draw. Part of the state comes from some
optimization that this tries to reproduce in a different way.

Review URL: https://codereview.chromium.org/839743003
2015-01-13 22:49:02 -08:00
kkinnunen
0cfeaf3ac1 debugger: Update inspector view data consistently while paused
Make all fields of inspector view (details tab, clipstack tab, geometry
view) update the correct info when user selects a draw command. Also
update the info regardless if the painting is paused or not.

Current clip and matrix will not update consistently even after this
patch, as they depend on stateful debug canvas draw (may be fixed
later).

Review URL: https://codereview.chromium.org/835903002
2015-01-07 07:33:47 -08:00
kkinnunen
26e5400de4 Remove draw window size state from SkDebugCanvas
The SkDebugCanvas can be (or is currently) being used to draw to multiple
different canvases. If this use-case is intended, then storing draw
-related state in the canvas causes bugs.

Remove draw window size state form SkDebugCanvas. Instead, use the canvas
base layer size as the window size to clip to. This is consistent with
the current use in debugger.

This is part of work trying to remove bugs in debugger that result from
replaying one SkDrawCanvas to two different canvases. Currently the
SkDrawCanvas stores state that can only be valid if it is used for one
canvas.

Review URL: https://codereview.chromium.org/835113002
2015-01-05 12:58:56 -08:00
kkinnunen
5a2315e750 debugger: Update the picture view when the first command is selected
Update the picture view in the debugger when the first command is
selected. DebugCanvas::drawTo(index) draws up to and including the index.

Review URL: https://codereview.chromium.org/837483002
2015-01-05 11:51:13 -08:00
kkinnunen
f3a9e99339 debugger: Remove few redundant variables
Use the GUI widget states instead of instance variables
reflecting the widget state.

Fixes the case where pause state would be left on when
switching files, but the image would change to the last
frame of newly loaded image.

Review URL: https://codereview.chromium.org/810033004
2015-01-05 01:14:11 -08:00
kkinnunen
5caff917f5 debugger: Move Skia initialization out of the GUI widget class
Move Skia initialization out of the GUI widget class to the
main function.

Before, Skia may have been already called before the SkGraphics::Init
was run.

Review URL: https://codereview.chromium.org/822583003
2015-01-02 07:24:14 -08:00
kkinnunen
7c339ae1e3 debugger: Make inspector widget smaller
Make inspector widget a bit smaller by letting the Qt widget system
layout the widgets.

Let the inspector widget calculate its own smallest size. Use stretch
factor of 0 for inspector, 1 for picture canvas.

Group the matrix and clip widgets in groups. Put the text edits in a grid
layout instead of a handwritted column layout containing row layouts.

This commit is part of work that tries to make the debugger window to be
a bit more resizeable, so that it would fit 1900x1200 screen.

Review URL: https://codereview.chromium.org/830743002
2015-01-02 06:35:43 -08:00
kkinnunen
63a470227b debugger: Make draw command image widget resize
Make draw command image widget resize. The widget was not resizing,
effectively preventing the window from being resized smaller.

Make the rasterized draw command image be proportional to the widget
size. The draw rasterization canvas is still an equilateral rectangle
with dimensions of the smaller side of the widget.

Makes the widget re-rasterize the image only when the draw command
changes, not for each widget paint.

Renames the widget from "image widget" to "draw command geometry
widget".

Makes the background of the image black, similar to the raster widget
background.

Adds a tooltip saying "Command geometry" for the widget, so that user might
understand what the contents should be.

This commit is part of work that tries to make the debugger window to be
a bit more resizeable, so that it would fit 1900x1200 screen.

Review URL: https://codereview.chromium.org/787143004
2014-12-30 23:03:56 -08:00
kkinnunen
41c79cc0ff debugger: Make settings widget resizeable
The settings widget was laid out by hand, eg. the widths of most
elements were hardcoded. This prevented it from being laid out by the Qt
widget system. This in turn prevents the widget from shrinking to its
optimal size. This in turn causes cascading effect where the geometry of
many of the UI widgets has to be hard-coded. This in turn prevents
proper resizing of the UI.

Make Qt layout the settings widget by following changes:

a) Group settings in QGroupBox groups instead of hand-written
layouts and labels hardcoded in certain places.

b) Remove "Expanding" size policy from settings widget. The widget
calculates its own size based on the widgets inside. Thus "Preferred"
is the correct policy to use, as expanding the widget will not
bring any new content visible.

c) Remove maximum width 250 from Settings widget

d) Make "canvas settings and image layout", eg. the horizontal layout
holding the settings widget divide the space between the picture and
settings like so: settings uses up only as much as it needs (stretch
factor 0), while picture uses up everything else (stretch factor 1).

In order to do a) reasonably, reorganize the UI and the code a bit:

a1) Rename settings group "visual filter" to "Visualizations".
a2) Make "visual filter: on/off" combo box a checkbox in
"Visualizations".
a3) Move "Mega viz" setting checkbox from "raster" (or "render targets")
section to "Visualizations"
a4) Move "PathOps" setting checkbox from "raster" to "Visualizations"

a5) Make Raster and GL checkboxes use QGroupBox checkbox feature

a6) Move "current command", "command hitbox" and "zoom level" from
"Settings" widget to part of "Inspector" concept. These pieces of
information are now visualized as their own box in the right-hand
bar, below settings.

a7) Do not expose settings user selects through the UI widgets
state that record the user interacts with. Instead, expose it as state
of the "settings widget". Thus settings widget provides "raster settings
changed" signal, which the client hook to and then query the state
through the object API.

This makes the full window a bit shorter.

This commit is part of work that tries to make the
debugger window to be a bit more resizeable, so that it would fit
1900x1200 screen.

Review URL: https://codereview.chromium.org/829933002
2014-12-30 22:49:58 -08:00
kkinnunen
5037e9de94 Change DebugCanvas API to not encourage memory leaks
Pass command strings and offset arrays as out parameters instead of
returning new arrays from the functions.

This simplifies debugger leak investigations, as the app leaks less by
design.

Review URL: https://codereview.chromium.org/821663003
2014-12-30 07:22:58 -08:00
kkinnunen
4be0238b11 Avoid leaking render targets in debugger
Render targets were not unreffed when QGLWidget::resizeGL was called.

Review URL: https://codereview.chromium.org/817243002
2014-12-22 06:06:41 -08:00
kkinnunen
534c63ea91 Make debugger raster window background black
Make debugger raster window background black. This helps to understand
where the picture boundaries are. It is probably more common for pictures to
have non-black background vs non-white background.

This makes raster window similar to opengl window.

Review URL: https://codereview.chromium.org/816363002
2014-12-22 05:56:45 -08:00
mtklein
f0f1411343 Cull pushCull and popCull from Skia.
These calls are unused and going away.  Waiting on crrev.com/796083002.

BUG=skia:

Review URL: https://codereview.chromium.org/794263002
2014-12-12 08:46:25 -08:00
mtklein
c6ad9eefa0 More SkPicture cleanup
- move field declarations together and pack them a little tighter
 - get rid of fData
 - remove dead code in debugger, including unused SkPicturePlayback subclass

There are now no more long-lived SkPictureData!  (Really, there never were,
but now we don't pretend to support them.)

BUG=skia:

No API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/725143002
2014-11-17 06:45:18 -08:00
kkinnunen
6438f9aca7 Fix debugger with GL to work with non-default locale
QApplication forces the process to use the C locale system on
"Unix/Linux" according to the docs.

The float numbers in GL shaders will be printed with printf. These will
be formatted with comma in certain locales, like LC_NUMERIC=fi_FI.UTF-8.

Force the NC_NUMERIC=C before running the QApplication.

Review URL: https://codereview.chromium.org/724753002
2014-11-13 05:13:50 -08:00
fmalita
8c89c528f3 Revert of Revert of SkDrawCommand scrubbing (patchset #1 id:1 of https://codereview.chromium.org/712683002/)
Reason for revert:
Chromium clients updated, this should be canary-proof now.

Original issue's description:
> Revert of SkDrawCommand scrubbing (patchset #2 id:20001 of https://codereview.chromium.org/706363002/)
>
> Reason for revert:
> Canary borkage.
>
> Original issue's description:
> > SkDrawCommand scrubbing
> >
> > Remove unused ctor, constify, etc.
> >
> > R=robertphillips@google.com
> >
> > Committed: https://skia.googlesource.com/skia/+/1931ec5b5dac68f1e452af0c65161bdce35b2dec
>
> TBR=robertphillips@google.com
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/9063ddd511f8e0d8c7454950cbc56e273678bf60

TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/708333002
2014-11-08 16:18:56 -08:00
fmalita
9063ddd511 Revert of SkDrawCommand scrubbing (patchset #2 id:20001 of https://codereview.chromium.org/706363002/)
Reason for revert:
Canary borkage.

Original issue's description:
> SkDrawCommand scrubbing
>
> Remove unused ctor, constify, etc.
>
> R=robertphillips@google.com
>
> Committed: https://skia.googlesource.com/skia/+/1931ec5b5dac68f1e452af0c65161bdce35b2dec

TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/712683002
2014-11-07 12:26:46 -08:00