Replace with std::unique_ptr.
Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176
Reviewed-on: https://skia-review.googlesource.com/4381
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
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
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
Add two drawPicture bracketing ops (BeginDrawPicture, EndDrawPicture) to
replace the current DrawPicture op, and flatten picture contents.
Review URL: https://codereview.chromium.org/1048383002
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
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
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
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
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
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
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
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
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
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
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
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
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