Commit Graph

5963 Commits

Author SHA1 Message Date
halcanary
a9ef92a5ed SkEncodedInfo: simplify
No public API change.
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2025713003

Review-Url: https://codereview.chromium.org/2025713003
2016-05-31 10:57:36 -07:00
robertphillips
93966d88ef Add SkLights class
The SkLights class is intended to be passed to the drawLitAtlas call (and then on to SkLightingShader).

This CL is calved off of https://codereview.chromium.org/1261433009/ (Add SkCanvas::drawLitAtlas call).
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1255133004

Review-Url: https://codereview.chromium.org/1255133004
2016-05-31 06:56:28 -07:00
fmalita
019db3fe88 Remove unused SkPictureGpuAnalyzer::analyze()
After https://crrev.com/c64bd21780da13051846ae45b54a1e6c6bf6ac52,
Chromium no longer uses analyze().

R=mtklein@google.com,reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2014983002

Review-Url: https://codereview.chromium.org/2014983002
2016-05-31 06:32:57 -07:00
scroggo
a4b09a117d Make SkPngCodec decode progressively.
This is a step towards using SkCodec in Chromium, where progressive
decoding is necessary.

Switch from using png_read_row (which expects all the data to be
available) to png_process_data, which uses callbacks when rows are
available.

Create a new API for SkCodec, which supports progressive decoding and
scanline decoding. Future changes will switch the other clients off of
startScanlineDecode and get/skip-Scanlines to the new API.

Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced
PNG images. In the new API, interlaced PNG fits kTopDown. Also remove
updateCurrScanline(), which was only used by the old implementation for
interlaced PNG.

DMSrcSink:
- In CodecSrc::kScanline_Mode, use the new method for scanline decoding
for the supported formats (just PNG and PNG-in-ICO for now).

fuzz.cpp:
- Remove reference to kNone_ScanlineOrder

SkCodec:
- Add new APIs:
    - startIncrementalDecode
    - incrementalDecode
- Remove kNone_SkScanlineOrder and updateCurrScanline()

SkPngCodec:
- Implement new APIs
- Switch from sk_read_fn/png_read_row etc to png_process_data
- Expand AutoCleanPng's role to decode the header and create the
  SkPngCodec
- Make the interlaced PNG decoder report how many lines were
  initialized during an incomplete decode
- Make initializeSwizzler return a bool instead of an SkCodec::Result
  (It only returned kSuccess or kInvalidInput anyway)

SkIcoCodec:
- Implement the new APIs; supported for PNG in ICO

SkSampledCodec:
- Call the new method for decoding scanlines, and fall back to the old
  method if the new version is unimplemented
- Remove references to kNone_SkScanlineOrder

tests/CodecPartial:
- Add a test which decodes part of an image, then finishes the decode,
  and compares it to the straightforward method

tests/CodecTest:
- Add a test which decodes all scanlines using the new method
- Repurpose the Codec_stripes test to decode using the new method in
  sections rather than all at once
- In the method check(), add a parameter for whether the image supports
  the new method of scanline decoding, and be explicit about whether an
  image supports incomplete
- Test incomplete PNG decodes. We should have been doing it anyway for
  non-interlaced (except for an image that is too small - one row), but
  the new method supports interlaced incomplete as well
- Make test_invalid_parameters test the new method
- Add a test to ensure that it's safe to fall back to scanline decoding without
  rewinding

BUG=skia:4211

The new version was generally faster than the old version (but not significantly so).

Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/

Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997703003

Review-Url: https://codereview.chromium.org/1997703003
2016-05-31 06:30:14 -07:00
mtklein
785a5b941a Clean up SkFloatBits
- remove dead code
- rewrite float -> int converters

The strategy for the new converters is:
   - convert input to double
   - floor/ceil/round in double space
   - pin that double to [SK_MinS32, SK_MaxS32]
   - truncate that double to int32_t

This simpler strategy does not work:
   - floor/ceil/round in float space
   - pin that float to [SK_MinS32, SK_MaxS32]
   - truncate that float to int32_t

SK_MinS32 and SK_MaxS32 are not representable as floats:
they round to the nearest float, ±2^31, which makes the
pin insufficient for floats near SK_MinS32 (-2^31+1) or
SK_MaxS32 (+2^31-1).

float only has 24 bits of precision, and we need 31.
double can represent all integers up to 50-something bits.

An alternative is to pin in float to ±2147483520, the last
exactly representable float before SK_MaxS32 (127 too small).

Our tests test that we round as floor(x+0.5), which can
return different numbers than round(x) for negative x.
So this CL explicitly uses floor(x+0.5).

I've updated the tests with ±inf and ±NaN, and tried to
make them a little clearer, especially using SK_MinS32
instead of -SK_MaxS32.

I have not timed anything here.  I have never seen any of these
methods in a profile.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2012333003

Review-Url: https://codereview.chromium.org/2012333003
2016-05-27 10:47:32 -07:00
bsalomon
78d58d1084 Make SkPath::isOval() and SkPath::isRRect return the orientation and starting index.
These are tracked in SkPathRef.

Unit tests are updated to test that the returned values are correct.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2012233002

Review-Url: https://codereview.chromium.org/2012233002
2016-05-27 09:17:04 -07:00
msarett
23c5110ba2 Add SkColorSpace to SkImageInfo
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=2000713003

Review-Url: https://codereview.chromium.org/2000713003
2016-05-27 07:39:02 -07:00
fmalita
b5fc58e1de Complex clipPath accounting
Add a clipPath heuristic to SkPathCounter, and extend
SkPictureGpuAnalyzer to support external clipPath() op accounting.

BUG=skia:5347
R=reed@google.com,mtklein@google.com,senorblanco@chromium.org,bsalomon@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2000423005

Review-Url: https://codereview.chromium.org/2000423005
2016-05-25 11:31:04 -07:00
bsalomon
7a5bcc5f59 Make Sk32ToBool inline again to silence compiler warning.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2007753003

Review-Url: https://codereview.chromium.org/2007753003
2016-05-24 13:23:56 -07:00
msarett
e077e0683a SkColorSpace tweaks
***Move includes to the correct file
***Add "const"
***Use std::move for more efficient refs and unrefs

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2005263002

Review-Url: https://codereview.chromium.org/2005263002
2016-05-24 10:16:53 -07:00
brianosman
a167e74b4b Remove sRGB overrides on GrTextureParams. Use GrPaint flags instead.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2002253002

Review-Url: https://codereview.chromium.org/2002253002
2016-05-24 06:18:48 -07:00
jvanverth
1d15596200 Add Xlib support to viewer
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=1999213002

Review-Url: https://codereview.chromium.org/1999213002
2016-05-23 13:13:36 -07:00
msarett
8cc2091118 Make SkColorSpace a public API
I've trimmed uniqueID for now, and added some comments.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1996973002

Review-Url: https://codereview.chromium.org/1996973002
2016-05-23 09:29:29 -07:00
halcanary
a0af771612 SkTypes: use constexpr when appropriate
motivation: https://codereview.chromium.org/2000853003

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2004073002

Review-Url: https://codereview.chromium.org/2004073002
2016-05-23 09:11:59 -07:00
robertphillips
87f15c8ff1 Retract GrRenderTarget from GrTestTarget
Split out of: https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=2004433002

Review-Url: https://codereview.chromium.org/2004433002
2016-05-20 11:14:33 -07:00
liyuqian
e46e4f075b Correct gesture scale and translation
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1996613002

Review-Url: https://codereview.chromium.org/1996613002
2016-05-20 07:32:19 -07:00
senorblanco
5878dbdf1b Image filters: implement SkImage::makeWithFilter().
This API provides a way to directly filter a subregion of an SkImage
(usually texture-backed), and returns an SkImage which may include
extra padding, along with a size to indicate the active region.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1964043002

Review-Url: https://codereview.chromium.org/1964043002
2016-05-19 14:50:29 -07:00
robertphillips
82ec6e59b8 Retract GrRenderTarget from GLProgramsTest
Split out of https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997773002

Review-Url: https://codereview.chromium.org/1997773002
2016-05-19 14:01:05 -07:00
robertphillips
5f2fa47a6e Make GrAppliedClip friendless
GrAppliedClip is a pretty amiable class but not so good about setting boundaries. It is probably for the best that it breaks things off with GrClipMaskManager before the drama of https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder) begins.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1993263002

Review-Url: https://codereview.chromium.org/1993263002
2016-05-19 11:36:25 -07:00
hcm
0876158ecd Update Skia milestone to 53 after 52 branch
TBR=reed@google.com

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1993203002

Review-Url: https://codereview.chromium.org/1993203002
2016-05-19 05:26:57 -07:00
tomhudson
cb3bd18a4b SkCanvas::adjustToTopLayer()
Given a matrix and a clip bounds, offsets them to reflect the difference
between device coordinates and global coordinates. Useful when a client
wants an OS-specific backing for a canvas.

R=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1986383002

Review-Url: https://codereview.chromium.org/1986383002
2016-05-18 07:24:16 -07:00
msarett
d1227a7417 Delete SkBitmapRegionCanvas
This was an approach we considered for implementing Android's
BitmapRegionDecoder.

It was useful for testing and comparison, but now is no longer worth
maintaining and testing.

The approach to subset/scaled decodes (clipped decode, then scale)
may be worth reconsidering at some point.

BUG=skia:5307
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1990543002

Review-Url: https://codereview.chromium.org/1990543002
2016-05-18 06:23:57 -07:00
brianosman
7888f780d8 Set the "mutable format" bit on sRGB images at creation time.
This allows us to later create an image view with a linear format, for
legacy-mode non-sRGB access.

No actual API change (just a comment change in public header).

TBR=bsalomon@google.com
BUG=skia:5308
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1981333004

Review-Url: https://codereview.chromium.org/1981333004
2016-05-17 11:47:32 -07:00
robertphillips
ca6eafc0f7 (Mostly) Retract GrRenderTarget from SkGpuDevice
This gets us most of the way to having SkGpuDevice exclusively use a GrDrawContext instead of a GrRenderTarget. There are a few other refactorings (e.g., rm need for fLegacyBitmap and accessRenderTarget) before the GrRenderTarget can be completely removed.

Has calved off:
https://codereview.chromium.org/1925313002/ (Tighten up SkSpecialSurface factory functions)
https://codereview.chromium.org/1925803004/ (Add sk_sp to SkSurface_Gpu and SkGpuDevice)
https://codereview.chromium.org/1956473002/ (Retract GrRenderTarget a bit within SkGpuDevice)
https://codereview.chromium.org/1979913002/ (Rename GrDrawingMgr::abandon to wasAbandoned & add a matching entry point to GrDrawingContext)
https://codereview.chromium.org/1982583002/ (Add isUnifiedMultisampled entry point to GrDrawContext)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1930013002

Review-Url: https://codereview.chromium.org/1930013002
2016-05-17 09:57:46 -07:00
msarett
b1be46b1d9 Ensure that SkColorTable->fCount is set properly after decodes
We now have some blits that will process the color table.

If we erroneously report that the size of the color table is 256,
we will do extra work and annoy MSAN.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1982753002

Review-Url: https://codereview.chromium.org/1982753002
2016-05-17 08:52:11 -07:00
bsalomon
edea94c356 Implement vulkan fence syncs for nanobench
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974913003

Review-Url: https://codereview.chromium.org/1974913003
2016-05-16 14:09:56 -07:00
robertphillips
071457b7fc Add isUnifiedMultisampled entry point to GrDrawContext
GrRenderTargetProxy supports the isUnifiedMultisampled call so GrDrawContext will be able to support it even when GrRenderTargetProxy-backed.

This is split out of: https://codereview.chromium.org/1930013002/ ((Mostly) Retract GrRenderTarget from SkGpuDevice)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1982583002

Review-Url: https://codereview.chromium.org/1982583002
2016-05-16 09:50:03 -07:00
robertphillips
7761d61876 Rename GrDrawingMgr::abandon to wasAbandoned & add a matching entry point to GrDrawingContext
Since GrDrawingContext is generally replacing GrRenderTarget, this is to provide functionality similar to GrRenderTarget::wasDestroyed.

This is split out of https://codereview.chromium.org/1930013002/ ((Mostly) Retract GrRenderTarget from SkGpuDevice)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1979913002

Review-Url: https://codereview.chromium.org/1979913002
2016-05-16 09:14:53 -07:00
fmalita
796e365999 SkPictureGpuAnalyzer
Stateful helper for gathering multi-picture GPU stats.

Exposes the existing SkPicture GPU veto semantics, while preserving
the SKP impl (which has some nice properties: lazy, hierarchical,
cached per pic).

R=reed@google.com,bsalomon@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974833003

Review-Url: https://codereview.chromium.org/1974833003
2016-05-13 11:40:07 -07:00
egdaniel
b2df0c2702 Refactor Vulkan image, texture, RTs so that create and getter handles match.
This allows allows us to track and notify clients when either side changes
and image layout.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974983002

Review-Url: https://codereview.chromium.org/1974983002
2016-05-13 11:30:37 -07:00
robertphillips
e576874b16 Retract GrRenderTarget a bit within SkGpuDevice
Split off of: https://codereview.chromium.org/1930013002/ ((Mostly) Retract GrRenderTarget from SkGpuDevice)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1956473002

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

Review-Url: https://codereview.chromium.org/1956473002
2016-05-13 11:20:46 -07:00
cdalton
846c051a48 Convert GrClip to an abstract base class
Converts GrClip to an abstract base class and adds a "GrFixedClip"
implementation. GrFixedClip denotes a clip implemented with fixed-
function hardware. GrFixedClip allows us to remove the stateful
"fClipMode" member from GrClipMaskManager, and in the future will
be able to nicely encapsulate window rectangles.

After this change GrClipMaskManager is just a wrapper around
GrDrawTarget. We may want to consider removing it altogether.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1971343002

Review-Url: https://codereview.chromium.org/1971343002
2016-05-13 10:25:00 -07:00
bsalomon
9fb420393e Add bounds to GrShape
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1970003003

Review-Url: https://codereview.chromium.org/1970003003
2016-05-13 09:23:38 -07:00
robertphillips
9837740dd5 Simplify GrSWMaskHelper
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974943002

Review-Url: https://codereview.chromium.org/1974943002
2016-05-13 05:47:23 -07:00
robertphillips
f054b1766b Swap SkGpuBlurUtils over to using SkIRects
We don't have to land this, but I found it more comforting for the blurring code to explicitly deal with SkIRects rather than SkRects with integer values.

Split out of: https://codereview.chromium.org/1959493002/ (Retract GrRenderTarget from SkGpuBlurUtils)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1968603003

Review-Url: https://codereview.chromium.org/1968603003
2016-05-13 05:06:19 -07:00
cdalton
862cff30ea Remove clip from GrPipelineBuilder
This eliminates a copy and will allow us to make the GrClip class
virutal.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1966903004

Review-Url: https://codereview.chromium.org/1966903004
2016-05-12 15:09:48 -07:00
cdalton
193d9cf8f2 Eliminate special case nvpr batch handling
Removes drawPathBatch methods from GrDrawTarget and GrDrawContext, and
integrates nvpr batches in with all the other batches.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1966763002

Review-Url: https://codereview.chromium.org/1966763002
2016-05-12 11:52:02 -07:00
fmalita
1e2e33a74d Remove SkPicture::hasText()
No longer used in Chromium.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1978533002

Review-Url: https://codereview.chromium.org/1978533002
2016-05-12 10:53:49 -07:00
bungeman
13b9c95295 Move SkTypeface to sk_sp.
Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933393002

Review-Url: https://codereview.chromium.org/1933393002
2016-05-12 10:09:31 -07:00
scroggo
9a9a7b29e5 Revert of Move SkTypeface to sk_sp. (patchset #5 id:80001 of https://codereview.chromium.org/1933393002/ )
Reason for revert:
fontmgr_iterAndroid failing to draw emoji. E.g. https://gold.skia.org/search2?blame=6296da736fbf40aae881650c239420f64e576c3f&unt=true&head=true&query=source_type%3Dgm

Original issue's description:
> Move SkTypeface to sk_sp.
>
> Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f

TBR=reed@google.com,fmalita@chromium.org,tomhudson@google.com,bungeman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1974783002
2016-05-12 06:22:30 -07:00
bungeman
6296da736f Move SkTypeface to sk_sp.
Review-Url: https://codereview.chromium.org/1933393002
2016-05-11 12:38:18 -07:00
bsalomon
18a2f9dff8 Add base class for GLTestContext and add new subclass VkTestContext.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1964243003

Review-Url: https://codereview.chromium.org/1964243003
2016-05-11 10:09:18 -07:00
robertphillips
ebf30e8415 Switch GrTextureToYUVPlanes over to newDrawContext calls
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1970743002

Review-Url: https://codereview.chromium.org/1970743002
2016-05-11 08:34:39 -07:00
bungeman
f077324e13 Remove SkFontHost.h.
What is left of this file is now in SkFontLCDConfig.h.

Review-Url: https://codereview.chromium.org/1945883002
2016-05-10 14:32:07 -07:00
bsalomon
6663acff01 Replace GrStrokeInfo with GrStyle.
A side effect is that arbitrary path effects can no be pushed deeper into the Ganesh flow for paths. They may be applied by path renderers.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1957363002

Committed: https://skia.googlesource.com/skia/+/33595bdf4b64a745f6340338d307e806e96c587f

Review-Url: https://codereview.chromium.org/1957363002
2016-05-10 09:14:17 -07:00
bsalomon
85d9667f59 Revert of Replace GrStrokeInfo with GrStyle. (patchset #4 id:160001 of https://codereview.chromium.org/1957363002/ )
Reason for revert:
Breaking some bots

Original issue's description:
> Replace GrStrokeInfo with GrStyle.
>
> A side effect is that arbitrary path effects can no be pushed deeper into the Ganesh flow for paths. They may be applied by path renderers.
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1957363002
>
> Committed: https://skia.googlesource.com/skia/+/33595bdf4b64a745f6340338d307e806e96c587f

TBR=egdaniel@google.com,robertphillips@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1967513002
2016-05-10 06:19:21 -07:00
bsalomon
33595bdf4b Replace GrStrokeInfo with GrStyle.
A side effect is that arbitrary path effects can no be pushed deeper into the Ganesh flow for paths. They may be applied by path renderers.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1957363002

Review-Url: https://codereview.chromium.org/1957363002
2016-05-10 05:57:27 -07:00
reed
82595b6fa4 refactor drawPath to have drawDevPath
pre-CL for larger change to support read-only paths

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1957263003

TBR=

Review-Url: https://codereview.chromium.org/1957263003
2016-05-09 17:48:46 -07:00
bsalomon
1b4c01c660 Make SkAssertResult work with SK_WARN_UNUSED_RESULT in Release on gcc
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1962723003

Review-Url: https://codereview.chromium.org/1962723003
2016-05-09 12:35:17 -07:00
bsalomon
9daa4b92d7 No error if function marked with SK_WARN_UNUSED_RESULT is used in SkAssertResult
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1955263002

Review-Url: https://codereview.chromium.org/1955263002
2016-05-09 09:14:36 -07:00
robertphillips
a8966a8a34 Reland of Simplify SkGpuBlurUtils::GaussianBlur method (patchset #1 id:1 of https://codereview.chromium.org/1956023002/ )
Reason for revert:
May not be as bad as was thought

Original issue's description:
> Revert of Simplify SkGpuBlurUtils::GaussianBlur method (patchset #2 id:20001 of https://codereview.chromium.org/1958603002/ )
>
> Reason for revert:
> Looks like it's causing some issues with the bleed_image GM.
>
> Original issue's description:
> > Simplify SkGpuBlurUtils::GaussianBlur method
> >
> > No one was using the canClobberSrc capability and moving the direct filtering case forward makes the rest of the logic simpler.
> >
> > Split out of: https://codereview.chromium.org/1959493002/ (Retract GrRenderTarget from SkGpuBlurUtils)
> >
> > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1958603002
> >
> > Committed: https://skia.googlesource.com/skia/+/56a85e69a8d034e0fdee00e8207cda0a9da06fee
>
> TBR=bsalomon@google.com,robertphillips@google.com
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/67a58dcd4a1e79e5832161ae953526d27893aa61

TBR=bsalomon@google.com,jvanverth@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.

Review-Url: https://codereview.chromium.org/1961953002
2016-05-09 06:45:37 -07:00
jvanverth
67a58dcd4a Revert of Simplify SkGpuBlurUtils::GaussianBlur method (patchset #2 id:20001 of https://codereview.chromium.org/1958603002/ )
Reason for revert:
Looks like it's causing some issues with the bleed_image GM.

Original issue's description:
> Simplify SkGpuBlurUtils::GaussianBlur method
>
> No one was using the canClobberSrc capability and moving the direct filtering case forward makes the rest of the logic simpler.
>
> Split out of: https://codereview.chromium.org/1959493002/ (Retract GrRenderTarget from SkGpuBlurUtils)
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1958603002
>
> Committed: https://skia.googlesource.com/skia/+/56a85e69a8d034e0fdee00e8207cda0a9da06fee

TBR=bsalomon@google.com,robertphillips@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1956023002
2016-05-06 13:05:09 -07:00
brianosman
14f850abfe Remove Sk(Float|Double)PinToFixed functions, only used in tests.
These were triggering compile-time floating point overflow for one user,
and we don't use them.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952303005

Review-Url: https://codereview.chromium.org/1952303005
2016-05-06 11:45:55 -07:00
cdalton
3ccf2e75ed Remove hasMixedSamples() from GrPipelineBuilder
This info is unknown until after any clip has been applied to the
stencil settings, so it's misleading to include in the builder.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952323002

Review-Url: https://codereview.chromium.org/1952323002
2016-05-06 09:41:16 -07:00
halcanary
3767cd6cff https://groups.google.com/forum/#!topic/skia-discuss/2F2she2nQMg
No public API changes.
TBR=reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1957503002

Review-Url: https://codereview.chromium.org/1957503002
2016-05-06 08:03:44 -07:00
robertphillips
524484b143 Revert of Retract GrRenderTarget a bit within SkGpuDevice (patchset #2 id:20001 of https://codereview.chromium.org/1956473002/ )
Reason for revert:
Experimental revert to track down perf regression

Original issue's description:
> Retract GrRenderTarget a bit within SkGpuDevice
>
> Split off of: https://codereview.chromium.org/1930013002/ ((Mostly) Retract GrRenderTarget from SkGpuDevice)
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1956473002
>
> Committed: https://skia.googlesource.com/skia/+/d215a95882485026d176a81bf58871276b21c89c

TBR=bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1954103002
2016-05-06 07:55:20 -07:00
bsalomon
055e192adc Take SkStrokeRec::InitStyle rather than SkPaint::Style in mask filter and DrawMask
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1955633002

Review-Url: https://codereview.chromium.org/1955633002
2016-05-06 07:22:58 -07:00
robertphillips
56a85e69a8 Simplify SkGpuBlurUtils::GaussianBlur method
No one was using the canClobberSrc capability and moving the direct filtering case forward makes the rest of the logic simpler.

Split out of: https://codereview.chromium.org/1959493002/ (Retract GrRenderTarget from SkGpuBlurUtils)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1958603002

Review-Url: https://codereview.chromium.org/1958603002
2016-05-06 07:17:49 -07:00
reed
68e99ac1cd remove alias for SkMatrix44.h -- chrome callers have been updated
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1949113006

TBR=

Review-Url: https://codereview.chromium.org/1949113006
2016-05-05 19:31:46 -07:00
mtklein
ffa4a9213b SkOncePtr -> SkOnce
It's always nice to kill off a synchronization primitive.
And while less terse, I think this new code reads more clearly.

... and, SkOncePtr's tests were the only thing now using sk_num_cores()
outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02

Review-Url: https://codereview.chromium.org/1953533002
2016-05-05 16:05:56 -07:00
brianosman
2d1ee7936e Added --deepColor option to SampleApp, triggers creation of a ten-bit/channel
buffer. (Only on Windows at the moment). Uses new effect to do the final
gamma adjustment

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1919993002

Review-Url: https://codereview.chromium.org/1919993002
2016-05-05 12:24:31 -07:00
robertphillips
d215a95882 Retract GrRenderTarget a bit within SkGpuDevice
Split off of: https://codereview.chromium.org/1930013002/ ((Mostly) Retract GrRenderTarget from SkGpuDevice)

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1956473002

Review-Url: https://codereview.chromium.org/1956473002
2016-05-05 12:03:29 -07:00
brianosman
35b784d48f Bring back sRGB-write-control as a caps bit.
We're not going to support this on Vulkan (yet), but want to still
have it as an option for GL. (The fallback alternative for our YUV use
case involves injecting expensive fragment shader code, which we'd like
to avoid).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1955603003

Review-Url: https://codereview.chromium.org/1955603003
2016-05-05 11:52:53 -07:00
mtklein
42846ed437 Modernize SkMutex and SkSemaphore.
- use <atomic>
   - fuse SkMutex and SkBaseMutex
   - fuse SkSemaphore and SkBaseSemaphore

Still TODO:
   - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name

I just didn't want to bother fixing all that up until I know this CL sticks.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002

No public API changes.
TBR=reed@google.com

Committed: https://skia.googlesource.com/skia/+/427c2819d9237d7d7729c59238036cfc73c072ea

Review-Url: https://codereview.chromium.org/1947153002
2016-05-05 10:57:37 -07:00
reed
959a2937d5 Revert of SkOncePtr -> SkOnce (patchset #1 id:1 of https://codereview.chromium.org/1949313003/ )
Reason for revert:
ok, I have no idea what's going on

Original issue's description:
> Reland of SkOncePtr -> SkOnce (patchset #1 id:1 of https://codereview.chromium.org/1945293004/ )
>
> Reason for revert:
> previous revert unneeded (I think)
>
> Original issue's description:
> > Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of https://codereview.chromium.org/1953533002/ )
> >
> > Reason for revert:
> > broken the Mac and Linux builders, e.g.:
> >
> > https://build.chromium.org/p/chromium/builders/Mac/builds/15151
> > https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052
> >
> > Original issue's description:
> > > SkOncePtr -> SkOnce
> > >
> > > It's always nice to kill off a synchronization primitive.
> > > And while less terse, I think this new code reads more clearly.
> > >
> > > ... and, SkOncePtr's tests were the only thing now using sk_num_cores()
> > > outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp.
> > >
> > > BUG=skia:
> > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002
> > > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
> > >
> > > Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02
> >
> > TBR=herb@google.com,mtklein@chromium.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/7eb33da7eede34c050b865dbb1b60c3dcea7191b
>
> TBR=herb@google.com,mtklein@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/82da9a8aa0ce648f36882830765b42e0ada6c0fa

TBR=herb@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/1948313002
2016-05-05 01:36:43 -07:00
reed
82da9a8aa0 Reland of SkOncePtr -> SkOnce (patchset #1 id:1 of https://codereview.chromium.org/1945293004/ )
Reason for revert:
previous revert unneeded (I think)

Original issue's description:
> Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of https://codereview.chromium.org/1953533002/ )
>
> Reason for revert:
> broken the Mac and Linux builders, e.g.:
>
> https://build.chromium.org/p/chromium/builders/Mac/builds/15151
> https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052
>
> Original issue's description:
> > SkOncePtr -> SkOnce
> >
> > It's always nice to kill off a synchronization primitive.
> > And while less terse, I think this new code reads more clearly.
> >
> > ... and, SkOncePtr's tests were the only thing now using sk_num_cores()
> > outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp.
> >
> > BUG=skia:
> > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002
> > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
> >
> > Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02
>
> TBR=herb@google.com,mtklein@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7eb33da7eede34c050b865dbb1b60c3dcea7191b

TBR=herb@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/1949313003
2016-05-05 01:28:56 -07:00
sclittle
d9f5d20f81 Revert of Modernize SkMutex and SkSemaphore. (patchset #2 id:20001 of https://codereview.chromium.org/1947153002/ )
Reason for revert:
This CL seems to have broken the Linux x64 and Mac
bots, e.g.

https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052
https://build.chromium.org/p/chromium/builders/Mac/builds/15151

The error appears to have something to do with new static initializers being
added.

Original issue's description:
> Modernize SkMutex and SkSemaphore.
>
>    - use <atomic>
>    - fuse SkMutex and SkBaseMutex
>    - fuse SkSemaphore and SkBaseSemaphore
>
> Still TODO:
>    - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name
>
> I just didn't want to bother fixing all that up until I know this CL sticks.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002
>
> No public API changes.
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/427c2819d9237d7d7729c59238036cfc73c072ea

TBR=herb@google.com,mtklein@chromium.org,reed@google.com,bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=609340

Review-Url: https://codereview.chromium.org/1945343003
2016-05-04 18:23:30 -07:00
reed
7eb33da7ee Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of https://codereview.chromium.org/1953533002/ )
Reason for revert:
broken the Mac and Linux builders, e.g.:

https://build.chromium.org/p/chromium/builders/Mac/builds/15151
https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052

Original issue's description:
> SkOncePtr -> SkOnce
>
> It's always nice to kill off a synchronization primitive.
> And while less terse, I think this new code reads more clearly.
>
> ... and, SkOncePtr's tests were the only thing now using sk_num_cores()
> outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02

TBR=herb@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/1945293004
2016-05-04 17:14:44 -07:00
reed
086eea93b1 Revert of SK_DECLARE_STATIC_MUTEX -> static SkMutex (patchset #1 id:1 of https://codereview.chromium.org/1948193002/ )
Reason for revert:
broken the Mac and Linux builders, e.g.:

https://build.chromium.org/p/chromium/builders/Mac/builds/15151
https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052

Original issue's description:
> SK_DECLARE_STATIC_MUTEX -> static SkMutex
>
> There's no need to use a macro to declare static SkMutexes any more
> (and there's likewise no need to restrict them to global scope).
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1948193002
>
> Committed: https://skia.googlesource.com/skia/+/5e56cfd3fa1041dbb83899844fb92fa9a2ef1009

TBR=mtklein@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/1945353003
2016-05-04 17:12:46 -07:00
mtklein
5e56cfd3fa SK_DECLARE_STATIC_MUTEX -> static SkMutex
There's no need to use a macro to declare static SkMutexes any more
(and there's likewise no need to restrict them to global scope).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1948193002

Review-Url: https://codereview.chromium.org/1948193002
2016-05-04 15:21:12 -07:00
mtklein
9bd3fc7fa9 SkOncePtr -> SkOnce
It's always nice to kill off a synchronization primitive.
And while less terse, I think this new code reads more clearly.

... and, SkOncePtr's tests were the only thing now using sk_num_cores()
outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/1953533002
2016-05-04 14:40:18 -07:00
mtklein
b37c68ad42 Simplify implementation of SkOnce to not need so many comments.
I think this version reads more clearly, and the key invariants are
expressed in code rather than comments:
   - race losers always go through an acquire
   - we never exit the function unless fState is Done

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1951013004

Review-Url: https://codereview.chromium.org/1951013004
2016-05-04 13:57:30 -07:00
benjaminwagner
9b92ebdf41 Remove executable bit from source code files.
TBR=reed
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952773002

Review-Url: https://codereview.chromium.org/1952773002
2016-05-04 13:45:06 -07:00
reed
0ccc62d4f7 move colorshader into its own .cpp, add color4f variant
Implemented as a different subclass for SkColorShader (which is also private) partly to make the CL clearer/simpler, and partly for flatten/unflatten compatibility. Later I'm sure we could combine these if that proves useful.

Lots of TODOs at the moment, but still valuable to get reviewed.

Note: this ignores the question (for the moment) about how to interpret SkColor in the larger world. That needs to happen, but this CL is more focused on what *else* to do besides handle the old-style input (and old-style pipeline).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1934313002

Review-Url: https://codereview.chromium.org/1934313002
2016-05-04 13:09:39 -07:00
robertphillips
76948d4faa Add Gr*Proxy classes
This isn't wired in anywhere yet.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002

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

Committed: https://skia.googlesource.com/skia/+/92605b35efa0155c44d24bd8415b4cc1db8831db

Review-Url: https://codereview.chromium.org/1937553002
2016-05-04 12:47:41 -07:00
mtklein
427c2819d9 Modernize SkMutex and SkSemaphore.
- use <atomic>
   - fuse SkMutex and SkBaseMutex
   - fuse SkSemaphore and SkBaseSemaphore

Still TODO:
   - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name

I just didn't want to bother fixing all that up until I know this CL sticks.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002

No public API changes.
TBR=reed@google.com

Review-Url: https://codereview.chromium.org/1947153002
2016-05-04 11:31:29 -07:00
brianosman
fad98562d8 Prototype code that turns any/every flattenable into JSON
This makes inspecting things in SkDebugger far more useful - any filter
or other complex object on the paint is ultimately visible. You still
have to do some guess work to figure out what the fields actually mean,
but you can at least cross-reference with the code in flatten().

Screenshots:
Before: https://screenshot.googleplex.com/a6JM5HBBe6G.png
After : https://screenshot.googleplex.com/XQfr4YJ6mnH.png

Changes to public API are just removals and changes to make
some functions virtual.

TBR=reed@google.com

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1920423002

Review-Url: https://codereview.chromium.org/1920423002
2016-05-04 11:06:28 -07:00
robertphillips
4f16e6361d Revert of Add Gr*Proxy classes (patchset #10 id:220001 of https://codereview.chromium.org/1937553002/ )
Reason for revert:
ASAN

Original issue's description:
> Add Gr*Proxy classes
>
> This isn't wired in anywhere yet.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002
>
> Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1
>
> Committed: https://skia.googlesource.com/skia/+/92605b35efa0155c44d24bd8415b4cc1db8831db

TBR=bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1944953002
2016-05-03 12:56:04 -07:00
reed
50d3b57c8a return 4x4 matrix from SkColorSpace
move SkMatrix44 into core (with alias in utils to transition chrome)

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1943833002

Review-Url: https://codereview.chromium.org/1943833002
2016-05-03 12:13:21 -07:00
bungeman
68f7460fd1 Add SK_API to SkFontLCDConfig.
This will allow transition from double deprecated SkFontHost.

TBR=reed
This is obviously needed to remove other code.

Review-Url: https://codereview.chromium.org/1951463002
2016-05-03 11:56:03 -07:00
jvanverth
2af0f1b014 Apply setImageLayout() to all of a VkImage's subresources.
This also adds fLevelCount to GrVkImage::Resource, which allows
clients to wrap mipmapped textures.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1943933002
TBR=bsalomon@google.com

Review-Url: https://codereview.chromium.org/1943933002
2016-05-03 10:36:49 -07:00
robertphillips
92605b35ef Add Gr*Proxy classes
This isn't wired in anywhere yet.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002

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

Review-Url: https://codereview.chromium.org/1937553002
2016-05-03 08:47:01 -07:00
robertphillips
89d09a1f70 Revert of Add Gr*Proxy classes (patchset #9 id:160001 of https://codereview.chromium.org/1937553002/ )
Reason for revert:
Seems to be breaking N7 & ANGLE bots

Original issue's description:
> Add Gr*Proxy classes
>
> This isn't wired in anywhere yet.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002
>
> Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1

TBR=bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1949463002
2016-05-03 06:44:50 -07:00
brianosman
444f1ba1b7 Remove SkBitmapHeap and SkBitmapHeapReader. They're unused.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1938033002

Review-Url: https://codereview.chromium.org/1938033002
2016-05-03 06:07:38 -07:00
jvanverth
db1adf5989 Revert of Make stencils be attachable to render targets created via SkSurface::MakeFromBackendTextureAsRender… (patchset #9 id:150001 of https://codereview.chromium.org/1924183003/ )
Reason for revert:
Appears to be breaking the roll.

Original issue's description:
> Make stencils be attachable to render targets created via SkSurface::MakeFromBackendTextureAsRenderTarget
>
> This is a regression from "Refactor to separate backend object lifecycle
> and GpuResource budget decision".
>
> GrGLRenderTarget::CreateWrapped creates only render targets that wrap
> the FBO.
> GrGLRenderTargetTexture::CreateWrapped creates render targets that
> wrap the texture.
>
> Use the latter as the implementation for
> SkSurface::MakeFromBackendTextureAsRenderTarget.
>
>
> BUG=608238
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1924183003
>
> Committed: https://skia.googlesource.com/skia/+/fe635fd76bbc375d527d1884af23cc617ca364ee
>
> Committed: https://skia.googlesource.com/skia/+/1cb00e42bff455e23f6883bf09680438fa631224

TBR=bsalomon@google.com,kkinnunen@nvidia.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=608238

Review-Url: https://codereview.chromium.org/1943843002
2016-05-03 05:37:46 -07:00
robertphillips
de5bf0cfec Add Gr*Proxy classes
This isn't wired in anywhere yet.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002

Review-Url: https://codereview.chromium.org/1937553002
2016-05-03 05:06:29 -07:00
kkinnunen
1cb00e42bf Make stencils be attachable to render targets created via SkSurface::MakeFromBackendTextureAsRenderTarget
This is a regression from "Refactor to separate backend object lifecycle
and GpuResource budget decision".

GrGLRenderTarget::CreateWrapped creates only render targets that wrap
the FBO.
GrGLRenderTargetTexture::CreateWrapped creates render targets that
wrap the texture.

Use the latter as the implementation for
SkSurface::MakeFromBackendTextureAsRenderTarget.

BUG=608238

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1924183003

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

Review-Url: https://codereview.chromium.org/1924183003
2016-05-02 23:16:42 -07:00
aam
cf975447a8 Make SkTime SK_API so that SkTime::GetDateTime() is visible to the clients.
# begin mtklein edits...
No public API changes.
TBR=reed@google.com
# end mtklein edits

BUG=skia:5230
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1930863003

Review-Url: https://codereview.chromium.org/1930863003
2016-05-02 15:04:46 -07:00
bungeman
0265707c19 Clean up SkFontConfigInterface implementation.
Renames some classes to avoid confusion with FontConfig.

Removed direct calls to FontConfig instead of calling FCI.

Moves the globals and factory to one (optional) file.

Moves font management code from typeface to font manager.

Adds index to fonts created from streams.

Associates FCI typefaces with the FCI instance which provides its identity.

Simplifies the singleton initialization.

Review-Url: https://codereview.chromium.org/1936213002
2016-05-02 11:54:13 -07:00
brianosman
18f13f3673 Remove (almost) unused read/writeFunctionPtr API.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937053002

Review-Url: https://codereview.chromium.org/1937053002
2016-05-02 07:51:08 -07:00
mtklein
59c12e3f00 remove non-static uses of SkOncePtr
Still slowly working through all the SK_DECLARE_STATIC_FOO macros.

SkOncePtr is complicating things by having SkOncePtr delete its pointer
and SkBaseOncePtr not.  Simplify things by removing SkOncePtr, leaving
only the leaky SkBaseOncePtr.

We replace SkOncePtr<T> instead with SkOnce and T.  In most cases this
did not need to be a pointer, and in some cases here we're even saving
a few bytes by replacing SkOncePtr<T> with SkOnce and a T.

The dependency map of SK_DECLARE_STATIC_FOO is:
  SkBaseMutex -> SkBaseSemaphore -> SkBaseOncePtr

They're intertwined enough that I think I've got to do all three in one
next CL.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1939503002

Review-Url: https://codereview.chromium.org/1939503002
2016-05-02 07:19:41 -07:00
brianosman
57b4615974 Remove unused encodedString API on SkWriteBuffer/SkReadBuffer
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936103002

Review-Url: https://codereview.chromium.org/1936103002
2016-05-02 07:09:25 -07:00
aleksandar.stojiljkovic
9516775857 Enable generating SkImage with the same uniqueID in SkImageGenerator subclass
Enable reusing uniqueID when instantiating SkImageGenerator subclasses enables
using uniqueID in client code to cache generated bitmaps with no need to keep
the reference to SkImageGenerator.

This is a bug fix for out of memory cause in chromium and 100% CPU usage
described in issue 165750#13:
- cache uses SkImage::uniqueID() to cache decoded bitmaps.
- every animation loop creates new SkImage instances.
- after decoding, bitmap copies are added to cache, filling it up with
duplicates of previous loops frames.

BUG=165750

Blink patch that depends on this:
https://codereview.chromium.org/1925533003/
"High CPU and increased memory usage fix for high-res (GIF, WEBP...) animations."

Review-Url: https://codereview.chromium.org/1928403002
2016-05-02 01:43:38 -07:00
mtklein
4d9ff62fa2 Remove SkWriter32::contiguousArray().
This method requires SkWriter32 have a contiguous array.
It does, and I plan to keep it that way (last time we checked
it's faster), but this turns that feature back into an
implementation detail.

This feature is only used by another unused feature, deep copies of
ops arrays in SkPictureData.  Kill that, kill this.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1932223003

Depends on https://codereview.chromium.org/1936563002/

Only deleting API
TBR=reed@google.com

Review-Url: https://codereview.chromium.org/1932223003
2016-04-29 14:45:36 -07:00
mtklein
e86e51fe7e Add reminders that these classes have constexpr default constructors.
We can do this now that we can write "constexpr".

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936653002

Review-Url: https://codereview.chromium.org/1936653002
2016-04-29 13:58:18 -07:00
mtklein
b4c899d48d remove SkWriteBuffer::getWriter32().
SkWriteBuffer exposes its lower-level implementation SkWriter32 through
this one call.  It's not currently used in any interesting way:
   - write_encoded_bitmap() uses it to manually re-create writeDataAsByteArray();
   - unit tests use it incidentally as a quick way to read the serialized bytes.

This should be SkWriteBuffer no longer necessarily needs to have an SkWriter32.

Landing this will let us then remove SkWriter32::contiguousArray().

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936563002

TBR=reed@google.com
Just deleting API

Review-Url: https://codereview.chromium.org/1936563002
2016-04-29 13:58:09 -07:00
mtklein
1b5dd88454 remove SkWriteBuffer::reserve()
We're not using it for anything that we can't do using the clearer writeFoo()/readFoo() methods.

The deletions in SkPictureFlat.{h,cpp} and BitmapHeapTest.cpp clean up dead code.
This code has not been used for a long time.  I happened to notice it because it
was another caller of reserve() (in a terrifyingly hacking/interesting way that
I bet we'll find I authored...)

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1930103003

Deleting APIs unused publicly.
TBR=reed@google.com

Review-Url: https://codereview.chromium.org/1930103003
2016-04-29 08:46:41 -07:00
bungeman
b4d46f03db Remove skstd::is_function.
The VC++ STL with 2015u2 now provides a complete std::is_function.
Also, Skia is no longer using skstd::is_function.

Review-Url: https://codereview.chromium.org/1929343002
2016-04-29 08:27:14 -07:00
bsalomon
5668648e87 Unify implementations of stroking radius calculationsns
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1928133002

Review-Url: https://codereview.chromium.org/1928133002
2016-04-29 07:07:03 -07:00
djsollen
efe46d2094 Repurpose Release_Developer BUILDTYPE and remove SK_DEVELOPER.
The Release_Developer build type is now used to build Skia with
release level optimizations but still enable SK_DEBUG. This in turn
means that SkASSERTS and SkRTConf are available in this mode.

Further we can then remove SK_DEVELOPER as a define as it is true
iff SK_DEBUG is true.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1931903002
DOCS_PREVIEW= https://skia.org/?cl=1931903002

Review-Url: https://codereview.chromium.org/1931903002
2016-04-29 06:41:35 -07:00