Commit Graph

2566 Commits

Author SHA1 Message Date
bsalomon
1c60dfe7ca Reland https://codereview.chromium.org/860333002 with fix for test failures.
Revert "Revert of Make GrScratchKey memory buffer correct size on copy (patchset #1 id:1 of https://codereview.chromium.org/860333002/)"

This reverts commit 988018c817.

BUG=skia:

Review URL: https://codereview.chromium.org/863983003
2015-01-21 09:32:40 -08:00
mtklein
988018c817 Revert of Make GrScratchKey memory buffer correct size on copy (patchset #1 id:1 of https://codereview.chromium.org/860333002/)
Reason for revert:
Our Valgrind bot just spewed out a weird error.  I don't know if it's related, but it looks at least like one of the stacks was in the right area, so I'm going to revert this precautionarily.  Sorry if this is a false positive.

http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/266/steps/dm/logs/stdio

Original issue's description:
> Make GrScratchKey memory buffer correct size on copy
>
> Scratch key memory buffer of a copy of a key was too big. The (new) copy
> was N times uint32_t bytes instead of N bytes.
>
> Adds few tests to resource cache. These tests would not catch the too
> big buffer. This is just a precaution for too small buffers. The main
> idea of the test change is that the scratch key should contain some
> information, so that lookup with a scratch key can also return no
> match. Otherwise testing of scratch lookup result is not indicative of
> correct code (eg. no-information scratch key will always match).
>
> Committed: https://skia.googlesource.com/skia/+/711ef4831363fb8cbdf061dc2c36c65b13c0ccf2

TBR=bsalomon@google.com,kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/864833003
2015-01-21 08:05:55 -08:00
kkinnunen
711ef48313 Make GrScratchKey memory buffer correct size on copy
Scratch key memory buffer of a copy of a key was too big. The (new) copy
was N times uint32_t bytes instead of N bytes.

Adds few tests to resource cache. These tests would not catch the too
big buffer. This is just a precaution for too small buffers. The main
idea of the test change is that the scratch key should contain some
information, so that lookup with a scratch key can also return no
match. Otherwise testing of scratch lookup result is not indicative of
correct code (eg. no-information scratch key will always match).

Review URL: https://codereview.chromium.org/860333002
2015-01-21 06:39:14 -08:00
reed
3f43f8ab9c remove dead SkPersp macros
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/864713002
2015-01-20 19:58:36 -08:00
halcanary
87f3ba4847 Simplify skiatest framework.
skiatest::Test class is now a simple struct.  Some
functionalty, such as counting errors or timing is now
handled elsewhere.

skiatest:Reporter is now a simpler abstract class.  The two
implementations handle test errors.

DM and pathops_unittest updated.

Review URL: https://codereview.chromium.org/830513004
2015-01-20 09:30:20 -08:00
joshualitt
873ad0e0b4 BUG=skia:
Review URL: https://codereview.chromium.org/815643005
2015-01-20 09:08:52 -08:00
egdaniel
71e236c03e Remove willReadDst from GrFragmentProcessor.
Since only XP's can read dst now, there is no reason to have this query on GrFP.
This also triggered a chain reaction of cleaning up/removing unnecessary code
elsewhere.

BUG=skia:

Review URL: https://codereview.chromium.org/851143003
2015-01-20 06:34:51 -08:00
sugoi
692135f968 YUV planes cache
- Added new classes to contain YUV planes of memory, along with the associated data.
- Used these classes in load_yuv_texture() to enable YUV planes caching
- Added a unit test for the new cache

BUG=450021

Review URL: https://codereview.chromium.org/851273003
2015-01-19 10:10:27 -08:00
bsalomon
afe3005be3 Require budget decision when creating a RenderTarget SkSurface.
Restructure SkGpuDevice creation:
*SkSurfaceProps are optional.
*Use SkSurfaceProps to communicate DF text rather than a flag.
*Tell SkGpuDevice::Create whether RT comes from cache or not.

Review URL: https://codereview.chromium.org/848903004
2015-01-16 07:32:33 -08:00
caryclark
45fa447460 new files for pathops geometric intersection
There's no gyp references to these new files,
so this should only have the effect of reducing
the size of the commit that turns this code on.

TBR=

Review URL: https://codereview.chromium.org/853223002
2015-01-16 07:04:10 -08:00
kkinnunen
678c1b019a Fold alpha to the draw in savelayer-draw-restore patterns with non-opaque draw
Fold alpha of a save layer call to the subsequent draw call paint, even when
the draw call paint color is already non-opaque.

Comparing the difference of the unoptimized and the optimized call pattern
with all (layer alpha, draw alpha) combinations, this produces
off-by-one pixels ~50% of the time.

Reduces layers of current desk_carsvg.skp (recorded with cross-process
picture image filters allowed) from 122 to 115.

BUG=skia:3119

Review URL: https://codereview.chromium.org/840483005
2015-01-16 05:04:36 -08:00
mtklein
0c278972d0 Why are we afraid of saveLayer() bounds?
They're only hints.  We can ignore them in this optimization.
My only hesitation is that this pattern doesn't seem to happen in our .skps.

BUG=skia:

Review URL: https://codereview.chromium.org/849243002
2015-01-15 08:08:10 -08:00
fmalita
1a178ca6dd Use device-space stroke width for SkDraw::drawRect() quick-reject
The stroke width needs to be CTM-adjusted when applied to device space
rects.

BUG=skia:3313
R=reed@google.com

Review URL: https://codereview.chromium.org/801353008
2015-01-15 06:01:23 -08:00
bsalomon
5236cf480d Make uncached textures uncached from the get go.
This avoids the problem of a newly created uncached texture causing a purge of cached resources.

BUG=chromium:445885

Review URL: https://codereview.chromium.org/846303002
2015-01-14 10:42:08 -08:00
mtklein
7c348a8097 DM can see into src/gpu. No need for relative include.
BUG=skia:

Review URL: https://codereview.chromium.org/853613004
2015-01-14 09:25:01 -08:00
mtklein
2c0e8f13a0 Remove self-assignment in a test.
BUG=skia:

Review URL: https://codereview.chromium.org/853723002
2015-01-14 08:49:10 -08:00
joshualitt
71c9260e6f More changes to bring together path / geo procs
BUG=skia:

Review URL: https://codereview.chromium.org/820783005
2015-01-14 08:12:47 -08:00
mtklein
199ba8e19b namespace {} trick for SK_DECLARE_STATIC_ONCE
Like all our other SK_DECLARE_STATIC_*, it's usually not a thread-safe
thing to put inside a function.  Adding namespace {} prevents that
syntactically.

Needs https://codereview.chromium.org/841263004/ to land first.

BUG=chromium:447890

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

Review URL: https://codereview.chromium.org/806473006
2015-01-13 08:40:23 -08:00
mtklein
6f07665768 Simplify SkInstCnt
This code requires fewer macros to use it (just one), has less code in macro
definitions, and has simpler synchronization code (just atomic ints, no SkOnce,
no SkMutex, etc.)

A minor downside, we lose indentation and reverse-ordering in the final report:
  Leaked SkRefCntBase: 7
     Leaked SkFontMgr: 1
     Leaked SkWeakRefCnt: 1
         Leaked SkTypeface: 1
     Leaked SkFlattenable: 3
         Leaked SkXfermode: 3
     Leaked SkPathRef: 1
     Leaked SkPixelRef: 1
         Leaked SkMallocPixelRef: 1
becomes
  Leaked SkXfermode: 3
  Leaked SkMallocPixelRef: 1
  Leaked SkPixelRef: 1
  Leaked SkPathRef: 1
  Leaked SkFlattenable: 3
  Leaked SkTypeface: 1
  Leaked SkWeakRefCnt: 1
  Leaked SkFontMgr: 1
  Leaked SkRefCntBase: 7

This is motivated by wanting to land https://codereview.chromium.org/806473006/,
which makes sure all static use of SkOnce are in global scope.  The current
implementation of SkInstCnt uses them in function scope, which isn't safe.
BUG=skia:

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

Review URL: https://codereview.chromium.org/841263004
2015-01-13 08:22:44 -08:00
halcanary
f361b71439 In SkPDFDocument::emitPDF(), stop pre-calculating file offsets.
* Add Streamer utility class which measures the current
  pdf offset by calling SkWStream::bytesWritten(). Calls
  SkPDFCatalog::setFileOffset() and SkPDFObject::emit() at
  the same time to guarantee that everything works out.

* SkPDFCatalog::setFileOffset() no longer calculates the
  object's size.

* SkPDFCatalog::setSubstituteResourcesOffsets() removed.

* SkPDFCatalog::emitSubstituteResources() removed and
  getSubstituteList() made public in its place.

* Remove SkPDFPage::getPageSize and SkPDFPage::emitPage.
  Replace with SkPDFPage::getContentStream().

* SkPDFObject::getOutputSize no longer virtual, only used in
  unit tests.  All SkPDFObject subclasses getOutputSize()
  overrides removed.

* SkPDFObject::getIndirectOutputSize removed.

* PDFPrimitivesTest updated for new functions.

Review URL: https://codereview.chromium.org/846023003
2015-01-13 07:12:57 -08:00
halcanary
4fc48af0d7 Change function signature of SkPDFObject::emitObject.
Replace virutal SkPDFObject::emitObject(s, c, true) with non-virtual
SkPDFObject::emitIndirectObject(s, c), since none of the subclasses do
(or should do) anything different.

Replace object->emitObject(s, c, false) with object->emitObject(s, c)

This is one step in simplifying the SkPDFObject interface to allow for
the next step in refactoring.

Review URL: https://codereview.chromium.org/827733004
2015-01-12 10:07:50 -08:00
mtklein
72c9faab45 Fix up all the easy virtual ... SK_OVERRIDE cases.
This fixes every case where virtual and SK_OVERRIDE were on the same line,
which should be the bulk of cases.  We'll have to manually clean up the rest
over time unless I level up in regexes.

for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end

BUG=skia:

Review URL: https://codereview.chromium.org/806653007
2015-01-09 10:06:40 -08:00
mtklein
703dd2ed18 Remove SkTileGrid (except for TileGridInfo).
TBR=reed@google.com

BUG=skia:3085

Review URL: https://codereview.chromium.org/845623002
2015-01-09 06:41:48 -08:00
reed
5965c8ae4e add ImageGenerator::NewFromData to porting layer
BUG=skia:3275

Review URL: https://codereview.chromium.org/834633006
2015-01-07 18:04:45 -08:00
mtklein
7e44bb1916 Remove macros that make it look like it's a good idea to not be able to flatten.
There are only a handful of SkFlattenables that are not flattenable.  That
there are any seems highly illogical.  To make this look less like a normal
thing, this removes both macros that marked SkFlattenables as non-flattenable
(in slightly different ways).

The handful of SkFlattenables in our codebase that can't be flattened now
assert violently that they can't be flattened.  They're internal or
part of animator... places where we'll never actually flatten them.

TestLooper and DummyRasterizer were so trivial that I just made them flattenable.

BUG=skia:

Review URL: https://codereview.chromium.org/841753002
2015-01-07 09:06:08 -08:00
robertphillips
783fe16b8e Rename SkDrawPictureCallback to SkPicture::AbortCallback
Committed: https://skia.googlesource.com/skia/+/7ef197255deb4e2fa64c03c7130d56ddf164e83c

Review URL: https://codereview.chromium.org/829983003
2015-01-07 07:28:41 -08:00
reed
8ea6dabbb1 Revert of Rename SkDrawPictureCallback to SkPicture::AbortCallback (patchset #2 id:20001 of https://codereview.chromium.org/829983003/)
Reason for revert:
speculative revert to unblock DEPS roll

Original issue's description:
> Rename SkDrawPictureCallback to SkPicture::AbortCallback
>
> Committed: https://skia.googlesource.com/skia/+/7ef197255deb4e2fa64c03c7130d56ddf164e83c

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

Review URL: https://codereview.chromium.org/824013004
2015-01-06 16:15:25 -08:00
robertphillips
7ef197255d Rename SkDrawPictureCallback to SkPicture::AbortCallback
Review URL: https://codereview.chromium.org/829983003
2015-01-06 12:26:08 -08:00
robertphillips
c4bd39c903 Require explicit disabling of cross process pictureimagefilters
This is to allow capturing .skp files with their pictureimagefilters intact.

This is a companion to https://codereview.chromium.org/810933004/ (Provide a way of allowing cross process pictureimagefilters).

Review URL: https://codereview.chromium.org/834673006
2015-01-06 09:17:02 -08:00
robertphillips
2b6ab61e22 Remove SkPath::asRect
AFAICT the asRect entry point is not needed.

Greg: GPU
Reed: API
Cary: Path

Review URL: https://codereview.chromium.org/833193002
2015-01-05 12:22:14 -08:00
robertphillips
91b0a35873 Cleanup isRect variants
Review URL: https://codereview.chromium.org/832083002
2015-01-05 10:13:46 -08:00
reed
41af966ab3 Revert of Revert of move remaining virtual draw methods to onDraw (patchset #1 id:1 of https://codereview.chromium.org/835913002/)
Reason for revert:
test to see if it wasn't this CL that broke chromeos

Original issue's description:
> Revert of move remaining virtual draw methods to onDraw (patchset #5 id:80001 of https://codereview.chromium.org/817723005/)
>
> Reason for revert:
> did this cause chromeos heap corruption on skp?
>
> Original issue's description:
> > move remaining virtual draw methods to onDraw
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/2e0f7d53bba5438c9bf11ee5ccae2c301e348419
>
> TBR=robertphillips@google.com,djsollen@google.com,bsalomon@google.com,mtklein@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e87e383351e1547b21d96d02bcd0c3cbbe0837f1

TBR=robertphillips@google.com,djsollen@google.com,bsalomon@google.com,mtklein@google.com,reed@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/831253002
2015-01-05 07:49:08 -08:00
mtklein
49aabde6ef Clean up dead clear() code in SkRecord.
This removes the SkRecords::Clear struct and everything that refers to it.
Notice there is nothing actually creating a Clear, which means this is all
dead code.

Now that all ops obey the clip, I don't think we need the weird
inflate-empty-to-epsilon hack for BBH queries.

BUG=skia:

Review URL: https://codereview.chromium.org/835813002
2015-01-05 07:02:45 -08:00
reed
e87e383351 Revert of move remaining virtual draw methods to onDraw (patchset #5 id:80001 of https://codereview.chromium.org/817723005/)
Reason for revert:
did this cause chromeos heap corruption on skp?

Original issue's description:
> move remaining virtual draw methods to onDraw
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2e0f7d53bba5438c9bf11ee5ccae2c301e348419

TBR=robertphillips@google.com,djsollen@google.com,bsalomon@google.com,mtklein@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/835913002
2015-01-05 04:49:38 -08:00
reed
2e0f7d53bb move remaining virtual draw methods to onDraw
BUG=skia:

Review URL: https://codereview.chromium.org/817723005
2015-01-04 21:09:04 -08:00
reed
c4fda92f45 remove unused drawData
BUG=skia:

Review URL: https://codereview.chromium.org/830083002
2015-01-02 06:39:51 -08:00
reed
b2497c2d94 change API contract: disallow zero-sized images or surfaces
BUG=skia:

Review URL: https://codereview.chromium.org/830033003
2014-12-31 12:31:43 -08:00
bsalomon
7775c85611 Add a simpler key type for scratch resource keys.
BUG=skia:2889

Review URL: https://codereview.chromium.org/815833004
2014-12-30 12:50:52 -08:00
robertphillips
fe7c427e3d Fix bound returned by SkPath::isRect when the path contains a trailing moveTo
Oddly enough this was fixed in:

https://codereview.chromium.org/16950021/ (add rect-output parameter to isRect, allowing us to return the correct bounds even if a rectagular path has a trailing moveTo)

but was reverted here:

https://skia.googlesource.com/skia/+/8fd160350ca5f57fbb1b2e03383c5778414a9b48

since it appeared to be crashing Chrome's trybots. I think it just fell through the cracks after that.

If this sticks I will land a follow on patch for the stroke issue reported in the original bug (crbug.com/247770).

BUG=247770,445368

Review URL: https://codereview.chromium.org/834483002
2014-12-29 11:36:39 -08:00
bsalomon
b0ae649b7e Add device space skshader GM to test kDevice_GrCoordSet
Review URL: https://codereview.chromium.org/816003002
2014-12-29 07:05:27 -08:00
reed
d990e2f14f add testing flag to ignore saveLayer bounds
BUG=skia:

Review URL: https://codereview.chromium.org/819123003
2014-12-22 11:58:30 -08:00
jvanverth
39edf7664f Rename GrGpuGL -> GrGLGpu
Review URL: https://codereview.chromium.org/824753002
2014-12-22 11:44:19 -08:00
robertphillips
f3f5bad7de Add toString methods to SkImageFilter-derived classes
This isn't definitive but at least makes something show up in the debugger.

Review URL: https://codereview.chromium.org/789163006
2014-12-19 13:49:15 -08:00
reed
53b9e2e0f2 add const to encodePixels pixel parameter
BUG=skia:

Review URL: https://codereview.chromium.org/788143007
2014-12-19 12:26:07 -08:00
reed
438b0d754d Enable new gradients + suppress gms for now
This reverts commit 2c770271e6.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/811753003
2014-12-19 07:40:26 -08:00
tfarina
1348dfd5df Cleanup: Remove a bunch of SkFontHost.h includes (unused).
Nobody that is including SkFontHost is using SkFontHost API, so lets
remove this includes, since the API per se is deprecated.

BUG=None
R=reed@google.com

Review URL: https://codereview.chromium.org/803733006
2014-12-18 05:48:53 -08:00
jvanverth
1334c21eee One more pass at getting half float texture configs correct.
Added in check for sized internal format.
Made choice between RED and ALPHA orthogonal to HALF_FLOAT and
HALF_FLOAT_OES.
Enabled rendertarget support on ES 2.0.

Review URL: https://codereview.chromium.org/805033002
2014-12-18 05:44:55 -08:00
bsalomon
3e79124a69 Stop creating GrODS for stencilPath commands.
Review URL: https://codereview.chromium.org/816513003
2014-12-17 13:43:13 -08:00
reed
220f926d9d use conics
BUG=skia:

Review URL: https://codereview.chromium.org/455043002
2014-12-17 08:21:05 -08:00
fs
88640cf363 SkMatrix44(const SkMatrix&) needs to initialize the type mask
Review URL: https://codereview.chromium.org/791723006
2014-12-16 08:36:11 -08:00
robertphillips
478dd72336 Fix layer hoisting image filter corner cases
This CL fixes 5 bugs related to hoisting image filters:

For image filters the src layer (the one prior to filtering) often needs to be
smaller then the final layer. This requires the saveLayer's optional bounds
to be stored (in SkLayerInfo.h and SkRecordDraw.cpp) and then used in
compute_source_rect and carried around in GrCachedLayer.

The image filters can add an extra offset to the final draw operation.
This is now computed in GrLayerHoister::FilterLayer and  carried around in
GrCachedLayer.

Filtered layers must use exact matches. This is now done in GrLayerCache::lock.

The filter cache requires a valid matrix so it can compute the correct offset.
This is now done in GrLayerHoister::FilterLayer.

Filtered layers need to be drawn with drawSprite while unfiltered (and therefore
hopefully atlased) layers can be drawn with drawBitmap. This is now done in
draw_replacement_bitmap.

Committed: https://skia.googlesource.com/skia/+/702eb9622102599d94ab6798e6227cf29f48c2d3

Review URL: https://codereview.chromium.org/803183003
2014-12-16 08:25:55 -08:00
robertphillips
86f032832f Revert of Fix layer hoisting image filter corner cases (patchset #3 id:40001 of https://codereview.chromium.org/803183003/)
Reason for revert:
Breaking DM

Original issue's description:
> Fix layer hoisting image filter corner cases
>
> This CL fixes 5 bugs related to hoisting image filters:
>
> For image filters the src layer (the one prior to filtering) often needs to be
> smaller then the final layer. This requires the saveLayer's optional bounds
> to be stored (in SkLayerInfo.h and SkRecordDraw.cpp) and then used in
> compute_source_rect and carried around in GrCachedLayer.
>
> The image filters can add an extra offset to the final draw operation.
> This is now computed in GrLayerHoister::FilterLayer and  carried around in
> GrCachedLayer.
>
> Filtered layers must use exact matches. This is now done in GrLayerCache::lock.
>
> The filter cache requires a valid matrix so it can compute the correct offset.
> This is now done in GrLayerHoister::FilterLayer.
>
> Filtered layers need to be drawn with drawSprite while unfiltered (and therefore
> hopefully atlased) layers can be drawn with drawBitmap. This is now done in
> draw_replacement_bitmap.
>
> Committed: https://skia.googlesource.com/skia/+/702eb9622102599d94ab6798e6227cf29f48c2d3

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

Review URL: https://codereview.chromium.org/790643009
2014-12-16 07:41:37 -08:00
bsalomon
861e103701 Rename GrGpuGL to GrGLGpu for consistency
Review URL: https://codereview.chromium.org/808593003
2014-12-16 07:33:50 -08:00
robertphillips
702eb96221 Fix layer hoisting image filter corner cases
This CL fixes 5 bugs related to hoisting image filters:

For image filters the src layer (the one prior to filtering) often needs to be
smaller then the final layer. This requires the saveLayer's optional bounds
to be stored (in SkLayerInfo.h and SkRecordDraw.cpp) and then used in
compute_source_rect and carried around in GrCachedLayer.

The image filters can add an extra offset to the final draw operation.
This is now computed in GrLayerHoister::FilterLayer and  carried around in
GrCachedLayer.

Filtered layers must use exact matches. This is now done in GrLayerCache::lock.

The filter cache requires a valid matrix so it can compute the correct offset.
This is now done in GrLayerHoister::FilterLayer.

Filtered layers need to be drawn with drawSprite while unfiltered (and therefore
hopefully atlased) layers can be drawn with drawBitmap. This is now done in
draw_replacement_bitmap.

Review URL: https://codereview.chromium.org/803183003
2014-12-16 07:27:30 -08:00
mtklein
9a5380dd35 Revert of Use SkPaint::getFontBounds() for text bounding boxes in pictures. (patchset #1 id:1 of https://codereview.chromium.org/805983003/)
Reason for revert:
Test-Win7-ShuttleA-HD2000-x86-Debug-GDI

Original issue's description:
> Use SkPaint::getFontBounds() for text bounding boxes in pictures.
>
> Now that SkTextBlobs have landed, this is a perf no-op, but it at least lets us eliminate a bunch of questionable hacks.
>
> CQ_EXTRA_TRYBOTS=client.skia:Test-Win7-ShuttleA-HD2000-x86-Debug-Trybot,Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug-Trybot
>
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/02d2b9831579173e783569530ab7bae08de907e9

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

Review URL: https://codereview.chromium.org/789793004
2014-12-16 06:31:01 -08:00
mtklein
02d2b98315 Use SkPaint::getFontBounds() for text bounding boxes in pictures.
Now that SkTextBlobs have landed, this is a perf no-op, but it at least lets us eliminate a bunch of questionable hacks.

CQ_EXTRA_TRYBOTS=client.skia:Test-Win7-ShuttleA-HD2000-x86-Debug-Trybot,Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug-Trybot

BUG=skia:

Review URL: https://codereview.chromium.org/805983003
2014-12-16 06:17:54 -08:00
scroggo
f9d610179d There can be only one (SkRandom)!
Remove SkLCGRandom. We already decided the new one was better, which is
why we wrote the new SkRandom.

Convert GMs that were using SkLCGRandom to use the improved SkRandom.
Motivated by the fact that these GMs draw differently on some runs. We
believe this to be a result of using the old SkLCGRandom.

Add each of the tests that were using SkLCGRandom to ignore-tests.txt,
since we expect they'll draw differently using SkRandom.

Move a trimmed down version of SkLCGRandom into SkDiscretePathEffect.
In order to preserve the old behavior, trim down SkLCGRandom to only
the methods used by SkDiscretePathEffect, and hide it in
SkDiscretePathEffect's cpp file.

BUG=skia:3241

Review URL: https://codereview.chromium.org/805963002
2014-12-15 12:54:51 -08:00
reed
5bcbe91304 Fix rrects that are large enough that we lose/gain a bit when we add the radius to a bounds coordinate.
add test that triggers assert in addRRect

BUG=skia:3239

Review URL: https://codereview.chromium.org/803153003
2014-12-15 12:28:33 -08:00
junov
3fcc125c77 Remove SkCanvas::isDrawingToLayer
BUG=3245

Review URL: https://codereview.chromium.org/803913005
2014-12-15 11:34:06 -08:00
reed
7534cf1703 ensure 4-byte alignment for storage, as SkWriterBuffer requires it
BUG=skia:3244

Review URL: https://codereview.chromium.org/805803002
2014-12-15 06:41:02 -08:00
reed
451e822705 add get9 and set9 to matrix, to aid in making keys
BUG=skia:
TBR=
NOTREECHECKS=True

Review URL: https://codereview.chromium.org/806543002
2014-12-13 08:46:49 -08:00
joshualitt
43893e4ca9 GLPrograms leak fix
NOTREECHECKS=True
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/799063005
2014-12-13 06:46:13 -08:00
bsalomon
fbaace0827 DM warning-free on win64
Review URL: https://codereview.chromium.org/805543002
2014-12-12 16:41:46 -08:00
bsalomon
9880607151 Even more win64 warning fixes
Review URL: https://codereview.chromium.org/800993002
2014-12-12 15:11:18 -08:00
jbroman
1607156689 Handle SkBitmaps which have no pixels in SkPDFImage.
A test that ensures this no longer crashes has been added.

BUG=skia:3232

Review URL: https://codereview.chromium.org/802713002
2014-12-12 11:28:16 -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
59dba146fe SkRecord: increase min block to 512B, remove max.
When we added the 64K allocation cap, the bots showed we took a perf hit
on some large .skps like desk_pokemonwiki.skp, despite not seeing a local
effect.  I'm still not seeing that locally, but I'd like to try removing the cap on
the bots to see what happens.  For big monolithic pictures, really packing into
memory tightly is probably not as important as it is for tiny ones.

Similarly, we're probably being too cautious about making tiny allocations.
Today we start at 16 bytes, which isn't really enough to record anything.
Even the smallest picture, say,
    save
        clipRect
        drawRect
    restore
requires ~200 bytes, so we might as well move our minimum block size up
near there.

I don't know if 16 bytes is too small to start for GrTextStrikes, so I've left the
behavior the same (though the max is still gone).

Local recording performance is neutral-to-positive:
             tabl_deviantart.skp	 126us ->  129us	1.02x
                tabl_nytimes.skp	 110us ->  112us	1.02x
           tabl_cuteoverload.skp	 521us ->  530us	1.02x
             desk_mobilenews.skp	 673us ->  682us	1.01x
             desk_chalkboard.skp	 843us ->  854us	1.01x
                 desk_sfgate.skp	 528us ->  535us	1.01x
            desk_silkfinance.skp	68.2us ->   69us	1.01x
                desk_youtube.skp	 623us ->  629us	1.01x
                desk_blogger.skp	 472us ->  475us	1.01x
     desk_jsfiddlehumperclip.skp	42.2us -> 42.5us	1.01x
                   desk_espn.skp	 255us ->  256us	1.01x
                   desk_ebay.skp	 174us ->  174us	1x
                desk_twitter.skp	 454us ->  455us	1x
                 tabl_pravda.skp	 200us ->  201us	1x
              desk_wordpress.skp	 782us ->  784us	1x
               desk_samoasvg.skp	 762us ->  761us	1x
                tabl_mozilla.skp	1.58ms -> 1.58ms	1x
               tabl_slashdot.skp	 107us ->  107us	1x
               tabl_techmeme.skp	 102us ->  102us	0.99x
            tabl_gamedeksiam.skp	 729us ->  724us	0.99x
                 tabl_nofolo.skp	65.3us -> 64.7us	0.99x
            desk_gmailthread.skp	 339us ->  336us	0.99x
                tabl_sahadan.skp	  91us ->   90us	0.99x
           desk_yahooanswers.skp	 144us ->  142us	0.99x
                   tabl_cnet.skp	 143us ->  141us	0.99x
             tabl_googleblog.skp	 206us ->  203us	0.99x
                    tabl_cnn.skp	 160us ->  158us	0.99x
               tabl_frantzen.skp	50.5us -> 49.6us	0.98x
               desk_linkedin.skp	 328us ->  323us	0.98x
                   tabl_digg.skp	 790us ->  769us	0.97x
         desk_jsfiddlebigcar.skp	40.6us -> 39.5us	0.97x
                 desk_mapsvg.skp	1.57ms -> 1.52ms	0.97x
                  tabl_gmail.skp	19.4us -> 18.6us	0.96x
                   tabl_hsfi.skp	9.81us -> 9.11us	0.93x

BUG=skia:

Review URL: https://codereview.chromium.org/793033002
2014-12-12 08:41:24 -08:00
jvanverth
a60b2ead80 Fix float and half float support on mobile.
It's unclear what params should be used for half float alpha
rendertargets, so they are disabled for the moment.

Review URL: https://codereview.chromium.org/799593002
2014-12-12 05:58:06 -08:00
kkinnunen
b5f4961b30 Fix GpuLayerCacheTest compile error
Fix GpuLayerCacheTest compile error:
GpuLayerCacheTest.cpp:120:34: error: comparison between signed and
unsigned integer expressions [-Werror=sign-compare]

gcc --version
gcc (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04) 4.6.4

Review URL: https://codereview.chromium.org/794003003
2014-12-12 05:29:12 -08:00
joshualitt
56995b5cc0 Remove GP from drawstate, revision of invariant output for GP
BUG=skia:

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

Review URL: https://codereview.chromium.org/791743003
2014-12-11 15:44:02 -08:00
egdaniel
c230414861 Create xfer processor backend.
This includes:
-Having an actual XP stage at the end of the gl pipeline.
-All Blending work is handled by XP until actually setting GL blend states
-GLPrograms test to test XP

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/4dffc940c430eec66d4707490eace19c9b3f7904

Review URL: https://codereview.chromium.org/764643004
2014-12-11 13:15:14 -08:00
scroggo
895c43b28b Replace EncodeBitmap with an interface.
Gives more flexibility to the caller to decide whether to use the
encoded data returned by refEncodedData().

Provides an implementation that supports the old version of
SkPicture::serialize().

TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely

BUG=skia:3190

Review URL: https://codereview.chromium.org/784643002
2014-12-11 10:53:58 -08:00
reed
7bc0b42567 update test after I added a clip call, making the count odd
BUG=skia:
TBR=
NOTREECHECKS=True
NOTRY=True

Review URL: https://codereview.chromium.org/797633002
2014-12-11 07:30:58 -08:00
reed
2ff1fcede1 Defer saves() until they're needed
patch from issue 759443006 at patchset 40001 (http://crrev.com/759443006#ps40001)

BUG=skia:

Review URL: https://codereview.chromium.org/767333002
2014-12-11 07:07:38 -08:00
joshualitt
294738268d Revert of Create xfer processor backend. (patchset #6 id:100001 of https://codereview.chromium.org/764643004/)
Reason for revert:
CL breaks windows DM

Original issue's description:
> Create xfer processor backend.
>
> This includes:
> -Having an actual XP stage at the end of the gl pipeline.
> -All Blending work is handled by XP until actually setting GL blend states
> -GLPrograms test to test XP
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4dffc940c430eec66d4707490eace19c9b3f7904

TBR=bsalomon@google.com,joshualitt@chromium.org,egdaniel@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/789343002
2014-12-10 15:03:01 -08:00
joshualitt
8c0f615fdd Revert of Remove GP from drawstate, revision of invariant output for GP (patchset #9 id:160001 of https://codereview.chromium.org/791743003/)
Reason for revert:
breaks mac

Original issue's description:
> Remove GP from drawstate, revision of invariant output for GP
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c6bc58eded89b0c0a36b8e20e193c200f297a0da

TBR=bsalomon@google.com,egdaniel@google.com,joshualitt@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/794843002
2014-12-10 14:12:22 -08:00
joshualitt
c6bc58eded Remove GP from drawstate, revision of invariant output for GP
BUG=skia:

Review URL: https://codereview.chromium.org/791743003
2014-12-10 13:48:57 -08:00
reed
96472deea7 dd readPixels to SkImage
patch from issue 789673007 at patchset 1 (http://crrev.com/789673007#ps1)

BUG=skia:

Review URL: https://codereview.chromium.org/793723002
2014-12-10 09:53:42 -08:00
Florin Malita
c54d8db4d1 Remove SkCanvas::drawBitmapMatrix()
R=mtklein@google.com, reed@google.com, robertphillips@google.com

Review URL: https://codereview.chromium.org/789033002
2014-12-10 12:02:16 -05:00
egdaniel
4dffc940c4 Create xfer processor backend.
This includes:
-Having an actual XP stage at the end of the gl pipeline.
-All Blending work is handled by XP until actually setting GL blend states
-GLPrograms test to test XP

BUG=skia:

Review URL: https://codereview.chromium.org/764643004
2014-12-10 07:43:50 -08:00
reed
3054be16df Remove canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul
patch from issue 781403002 at patchset 20001 (http://crrev.com/781403002#ps20001)

BUG=skia:
TBR=
re-landing after chrome fixes have landed

Review URL: https://codereview.chromium.org/784223007
2014-12-10 07:24:28 -08:00
reed
67f2eb45b9 fix surface test for gpu and codecs
BUG=skia:

Review URL: https://codereview.chromium.org/789173004
2014-12-10 06:54:06 -08:00
reed
a8918a0650 Revert of remove (dumb) canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul (patchset #3 id:40001 of https://codereview.chromium.org/790733003/)
Reason for revert:
need to update chrome first

Original issue's description:
> remove (dumb) canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul
>
> patch from issue 781403002 at patchset 20001 (http://crrev.com/781403002#ps20001)
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2c1605a1fbaa2e35a27399a34254fb1200ec2ae6

TBR=fmalita@google.com,fmalita@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/791763002
2014-12-09 13:55:20 -08:00
joshualitt
2e3b3e369d This cl moves color and coverage off of drawstate. In an effort to keep this CL manageable, I have left the compute invariant input / output in a bit of a strange state(fixing this will be complicated).
In addition, NVPR makes this very complicated, and I haven't quite figured out a good way to handle it, so for now color and coverage DO live on optstate, but I will figure out some way to refactor that in future CLs.

BUG=skia:

Review URL: https://codereview.chromium.org/783763002
2014-12-09 13:31:15 -08:00
reed
2c1605a1fb remove (dumb) canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul
patch from issue 781403002 at patchset 20001 (http://crrev.com/781403002#ps20001)

BUG=skia:

Review URL: https://codereview.chromium.org/790733003
2014-12-09 12:33:38 -08:00
reed
a8b326c01a change SkPoint::setLength to set itself to (0,0) if it starting length is degenerate.
BUG=skia:3203
TBR=caryclark

Review URL: https://codereview.chromium.org/785933003
2014-12-09 11:50:33 -08:00
egdaniel
9513143efa Make all blending up to GrOptDrawState be handled by the xp/xp factory.
In this cl the blending information is extracted for the xp and stored in the ODS
which is then used as it currently is. In the follow up cl, an XP backend will be added
and at that point all blending work will take place inside XP's.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4

Review URL: https://codereview.chromium.org/759713002
2014-12-09 11:15:44 -08:00
scroggo
3030445799 Revert of Replace EncodeBitmap with an interface. (patchset #12 id:210001 of https://codereview.chromium.org/784643002/)
Reason for revert:
Failing serialization tasks in DM:

http://build.chromium.org/p/client.skia/builders/Test-Win8-ShuttleA-GTX660-x86-Debug/builds/352/steps/dm/logs/stdio

Original issue's description:
> Replace EncodeBitmap with an interface.
>
> Gives more flexibility to the caller to decide whether to use the
> encoded data returned by refEncodedData().
>
> Provides an implementation that supports the old version of
> SkPicture::serialize().
>
> TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely
>
> BUG=skia:3190
>
> Committed: https://skia.googlesource.com/skia/+/0c4aba6edb9900c597359dfa49d3ce4a41bc5dd1
>
> Committed: https://skia.googlesource.com/skia/+/02b217f80b01a7dda8493422e5257c36a9ce8464

TBR=reed@google.com,rmistry@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:3190

Review URL: https://codereview.chromium.org/783393004
2014-12-09 08:27:37 -08:00
scroggo
02b217f80b Replace EncodeBitmap with an interface.
Gives more flexibility to the caller to decide whether to use the
encoded data returned by refEncodedData().

Provides an implementation that supports the old version of
SkPicture::serialize().

TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely

BUG=skia:3190

Committed: https://skia.googlesource.com/skia/+/0c4aba6edb9900c597359dfa49d3ce4a41bc5dd1

Review URL: https://codereview.chromium.org/784643002
2014-12-09 07:44:36 -08:00
robertphillips
c0708cb7bc Revert of Replace EncodeBitmap with an interface. (patchset #11 id:190001 of https://codereview.chromium.org/784643002/)
Reason for revert:
Compilation is failing on some bots

Original issue's description:
> Replace EncodeBitmap with an interface.
>
> Gives more flexibility to the caller to decide whether to use the
> encoded data returned by refEncodedData().
>
> Provides an implementation that supports the old version of
> SkPicture::serialize().
>
> TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely
>
> BUG=skia:3190
>
> Committed: https://skia.googlesource.com/skia/+/0c4aba6edb9900c597359dfa49d3ce4a41bc5dd1

TBR=reed@google.com,scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:3190

Review URL: https://codereview.chromium.org/787833002
2014-12-09 05:35:07 -08:00
scroggo
0c4aba6edb Replace EncodeBitmap with an interface.
Gives more flexibility to the caller to decide whether to use the
encoded data returned by refEncodedData().

Provides an implementation that supports the old version of
SkPicture::serialize().

TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely

BUG=skia:3190

Review URL: https://codereview.chromium.org/784643002
2014-12-09 05:23:12 -08:00
egdaniel
8d95ffa497 Revert of Make all blending up to GrOptDrawState be handled by the xp/xp factory. (patchset #7 id:140001 of https://codereview.chromium.org/759713002/)
Reason for revert:
break many gm's

Original issue's description:
> Make all blending up to GrOptDrawState be handled by the xp/xp factory.
>
> In this cl the blending information is extracted for the xp and stored in the ODS
> which is then used as it currently is. In the follow up cl, an XP backend will be added
> and at that point all blending work will take place inside XP's.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4

TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/766653008
2014-12-08 13:26:43 -08:00
egdaniel
7c66342a39 Make all blending up to GrOptDrawState be handled by the xp/xp factory.
In this cl the blending information is extracted for the xp and stored in the ODS
which is then used as it currently is. In the follow up cl, an XP backend will be added
and at that point all blending work will take place inside XP's.

BUG=skia:

Review URL: https://codereview.chromium.org/759713002
2014-12-08 11:20:40 -08:00
caryclark
d3d1a988b1 add convexity logic and tests for scalar max, Inf, and NaN
PathOps relies on isConvex() only returning true for trivially
convex paths. The old logic also returns true if the paths that
contain NaNs and Infinities. Return kUnknown_Convexity instead
in those cases and in cases where the convexity logic computes
intermediaries that overflow.

Review URL: https://codereview.chromium.org/784593002
2014-12-08 04:57:38 -08:00
jvanverth
28f9c606e4 Add support for half float alpha textures.
This allows us to create distance field textures with better precision,
which may help text quality.

BUG=skia:3103

Review URL: https://codereview.chromium.org/762923003
2014-12-05 13:06:35 -08:00
joshualitt
eb2a676165 Remove backend factories
BUG=skia:

Review URL: https://codereview.chromium.org/778453002
2014-12-04 11:35:34 -08:00
joshualitt
dafa4d09cb move program descriptor generation to flush
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/829e1b80b1020b17f2078020c990e079b70c077c

Review URL: https://codereview.chromium.org/777673003
2014-12-04 08:59:10 -08:00
mtklein
c88cedaf88 Fix up RecordReplaceDrawTest memory leak.
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/151/steps/dm/logs/stdio

BUG=skia:

Review URL: https://codereview.chromium.org/779973002
2014-12-04 07:53:21 -08:00
reed
8eddfb50c0 Change clear() to respect the clip
This reverts commit af641a1c10.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/783493002
2014-12-04 07:50:14 -08:00
joshualitt
f78c60c92a Revert of move program descriptor generation to flush (patchset #7 id:120001 of https://codereview.chromium.org/777673003/)
Reason for revert:
breaking linux build

Original issue's description:
> move program descriptor generation to flush
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/829e1b80b1020b17f2078020c990e079b70c077c

TBR=egdaniel@google.com,bsalomon@google.com,joshualitt@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/776243005
2014-12-04 06:01:45 -08:00
joshualitt
829e1b80b1 move program descriptor generation to flush
BUG=skia:

Review URL: https://codereview.chromium.org/777673003
2014-12-03 13:57:37 -08:00
robertphillips
e99d499caa Fuse GrReplacements and GrLayerCache
The conversion step from GrCachedLayer to ReplacementInfo isn't necessary.

Review URL: https://codereview.chromium.org/769533004
2014-12-03 07:33:57 -08:00
joshualitt
2dd1ae016d First step to moving vertex attributes to the geometryProcessor
BUG=skia:

Review URL: https://codereview.chromium.org/761563002
2014-12-03 06:24:10 -08:00
reed
af641a1c10 Revert "Change clear() to respect the clip"
This reverts commit 3729469d6a.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/778563002
2014-12-02 19:40:18 -08:00
reed
3729469d6a Change clear() to respect the clip
patch from issue 769703002 at patchset 1 (http://crrev.com/769703002#ps1)

BUG=skia:

Review URL: https://codereview.chromium.org/772533004
2014-12-02 10:08:11 -08:00
halcanary
d476a176b7 Remove PDF JPEG shortcut, since it fails on grayscale JPEGs.
BUG=436079

Review URL: https://codereview.chromium.org/767343002
2014-12-02 06:37:21 -08:00
mtklein
3f3b3d0035 Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.
This was needed for pictures before v33, and we're now requiring v35+.

Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/52c293547b973f7fb5de3c83f5062b07d759ab88

Review URL: https://codereview.chromium.org/769953002
2014-12-01 11:47:08 -08:00
mtklein
6e78293ee8 Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (patchset #1 id:1 of https://codereview.chromium.org/769953002/)
Reason for revert:
Breaks canary builds.  Will reland after the Chromium change lands.

Original issue's description:
> Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.
>
> This was needed for pictures before v33, and we're now requiring v35+.
>
> Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/52c293547b973f7fb5de3c83f5062b07d759ab88

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

Review URL: https://codereview.chromium.org/768183002
2014-12-01 10:56:05 -08:00
mtklein
52c293547b Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.
This was needed for pictures before v33, and we're now requiring v35+.

Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc

BUG=skia:

Review URL: https://codereview.chromium.org/769953002
2014-12-01 10:23:11 -08:00
robertphillips
01d6e5f462 Use variable length key (rather than accumulated matrix) as save layer hoisting key
Adding the rendering canvas' CTM to the layer hoisting key (i.e., Add support for hoisting layers in pictures drawn with a matrix - https://codereview.chromium.org/748853002/) has increased the cache miss rate due to accumulated floating point error. This CL fixes part of the issue by using the chain of operation indices leading to each saveLayer as the key. The canvas' CTM must still form part of the key but should be less subject to accumulated error.

BUG=skia:2315

Review URL: https://codereview.chromium.org/753253002
2014-12-01 09:09:27 -08:00
jvanverth
936799204b Add float-to-half (binary16) conversion functions.
Based on code by Fabian Giesen at
https://fgiesen.wordpress.com/2012/03/28/half-to-float-done-quic/.

These will be needed for creating binary16 textures from floating point data.

BUG=skia:3103

Review URL: https://codereview.chromium.org/760753003
2014-11-26 13:15:59 -08:00
reed
f0090cb80a add basic tests for save/restore counting
BUG=skia:

Review URL: https://codereview.chromium.org/763503003
2014-11-26 08:55:51 -08:00
joshualitt
267ce482b5 remove proc key
BUG=skia:

Review URL: https://codereview.chromium.org/755363002
2014-11-25 14:52:21 -08:00
mtklein
b116619028 Sk4x_sse.h
CQ_EXTRA_TRYBOTS=client.skia:Test-Mac10.6-MacMini4.1-GeForce320M-x86_64-Release-Trybot,Test-Mac10.7-MacMini4.1-GeForce320M-x86_64-Release-Trybot,Test-Win7-ShuttleA-HD2000-x86-Debug-GDI-Trybot

BUG=skia:

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

Review URL: https://codereview.chromium.org/698873003
2014-11-25 11:00:38 -08:00
bsalomon
a2c2323005 Remove GrSurface::isSameAs
Review URL: https://codereview.chromium.org/753783003
2014-11-25 07:41:12 -08:00
bsalomon
10e23caea3 Use scratch keys for stencil buffers.
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/91175f19664a62851da4ca4e0984a7c7c45b258f

Review URL: https://codereview.chromium.org/747043004
2014-11-25 05:52:06 -08:00
reed
afa278e250 more c
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/736133006
2014-11-24 19:11:48 -08:00
reed
1bdfd3f4f0 option to return drawable from recording
patch from issue 747033005 at patchset 80001 (http://crrev.com/747033005#ps80001)

BUG=skia:

Review URL: https://codereview.chromium.org/732653004
2014-11-24 14:41:51 -08:00
mtklein
bbb61d7268 make SkRefCnt::getRefCnt() debug-only, remove it from SkNVRefCnt.
Only (unused) API removed.
TBR=reed@google.com

BUG=skia:3160

Review URL: https://codereview.chromium.org/752263002
2014-11-24 13:09:39 -08:00
bsalomon
19cd0f1813 Revert "Use scratch keys for stencil buffers."
This reverts commit 91175f1966.

Revert "Cleanup res cache bench and split out into a unit test."

This reverts commit 4e4303f002.

Revert "rebaselines"

This reverts commit 65ba7b5775.

TBR=tomhudson@google.com

Review URL: https://codereview.chromium.org/752233002
2014-11-24 12:19:06 -08:00
reed
90d0ff013b add some debugging to SkNVRefCnt
BUG=skia:

Review URL: https://codereview.chromium.org/745383003
2014-11-24 12:02:31 -08:00
bsalomon
4e4303f002 Cleanup res cache bench and split out into a unit test.
BUG=skia:2889

Review URL: https://codereview.chromium.org/754833002
2014-11-24 08:25:05 -08:00
mtklein
04c9695055 Remove Picture deletion listeners.
Looks like we can just have ~SkPicture put the message on the bus directly.

BUG=skia:3144

Review URL: https://codereview.chromium.org/751663002
2014-11-24 08:20:58 -08:00
bsalomon
932f866987 Create GrOptDrawState directly in the cmd buffer in GrIODB.
Review URL: https://codereview.chromium.org/746243002
2014-11-24 06:47:48 -08:00
bsalomon
77d77f446d Add pop_back to GrTRecorder.h
Review URL: https://codereview.chromium.org/750613002
2014-11-21 14:38:06 -08:00
reed
4af267b119 add SkImage::newSurface
BUG=skia:

Review URL: https://codereview.chromium.org/741763002
2014-11-21 08:46:38 -08:00
mtklein
19996eda62 Small changes to get things building and running on Linux/ARM.
ninja -C out/Debug works, and I tested out/Debug/dm --nogpu (no X yet).

The only problems encountered were:
  - Like CrOS, I also needed to use the default float ABI (presumably hard).
  - The strings in GrBinHashKeyTest weren't necessarily 4-byte aligned.

BUG=skia:

Review URL: https://codereview.chromium.org/746043002
2014-11-21 06:48:43 -08:00
fmalita
8ebaa71712 Revert of SkCanvas::clear() should call down to devices even when the clip is empty. (patchset #1 id:1 of https://codereview.chromium.org/735233003/)
Reason for revert:
Chrome unit_tests failures on Mac & Win, blocking the roll: http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/5613

Original issue's description:
> SkCanvas::clear() should call down to devices even when the clip is empty.
>
> SkDrawIter had a lovely, completely unused, option for this.  Oversight?
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/378e70d8e561b72a904286ea231946f5c8345b9a

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

Review URL: https://codereview.chromium.org/748733002
2014-11-20 20:44:04 -08:00
fmalita
2d97bc139a Disable LCD text explicitly in SkPictureImageFilter::onFilterImage()
As an intermediate fix for
https://code.google.com/p/skia/issues/detail?id=3142, we can use a
non-public SkCanvas constructor and force-disable LCD text.

BUG=skia:3142
R=reed@google.com,senorblanco@google.com

Review URL: https://codereview.chromium.org/725243004
2014-11-20 10:44:58 -08:00
bsalomon
b03c4a35bd Don't use NULL GrOptDrawState to indicate that draw should be skipped.
Review URL: https://codereview.chromium.org/742853002
2014-11-20 09:56:11 -08:00
mtklein
08d1fccf6e Add SkNVRefCnt, prune down SkPicture's size
SkNVRefCnt is a variant of SkRefCnt that's Not Virtual, so weighs 4 bytes
instead of 8 or 16.  There's only benefit to doing this if the deriving class
does not otherwise need a vtable, e.g. SkPicture.

I've stripped out some cruft from SkPicture, rearranged fields to pack tightly,
and added compile asserts for the sizes of SkPicture, SkRecord, and
SkVarAlloc.

BUG=skia:3144

Review URL: https://codereview.chromium.org/741793002
2014-11-20 09:18:32 -08:00
mtklein
378e70d8e5 SkCanvas::clear() should call down to devices even when the clip is empty.
SkDrawIter had a lovely, completely unused, option for this.  Oversight?

BUG=skia:

Review URL: https://codereview.chromium.org/735233003
2014-11-20 08:58:02 -08:00
mtklein
7cc1a34fbf Make sure pictures draw Clears even when the clip is empty.
We fix this by rewriting empty queries to very tiny queries, which will certainly
hit ops that span the entire picture (like Clear) and hopefully not much more.

(This doesn't quite work in the full cull rect world if [0,0,ε,ε] doesn't
overlap the picture.  Let's cross that bridge when we get there.)

BUG=432991

Review URL: https://codereview.chromium.org/732723004
2014-11-20 08:01:09 -08:00
tomhudson
158fcaa031 Implement SkPicture::bytesUsed() for SkRecord backend
BUG=chromium:230419
R=mtklein@google.com,reed@google.com

Review URL: https://codereview.chromium.org/490253003
2014-11-19 10:41:14 -08:00
joshualitt
54e0c12a5a scissor state on optstate
waiting

BUG=skia:

Review URL: https://codereview.chromium.org/742763002
2014-11-19 09:38:51 -08:00
bsalomon
ae59b77612 Create GrOptDrawState before recording draw in GrInOrderDrawBuffer
Review URL: https://codereview.chromium.org/739673002
2014-11-19 08:23:49 -08:00
reed
78e2768897 Allow pictures to have a full bounds
This reverts commit 7c4cdd2c5b.

BUG=skia:

Review URL: https://codereview.chromium.org/738083002
2014-11-19 08:04:34 -08:00
reed
7c4cdd2c5b Revert of allow pictures to have a full bounds (patchset #3 id:40001 of https://codereview.chromium.org/736583004/)
Reason for revert:
needed to update legacy width() helpers

Original issue's description:
> allow pictures to have a full bounds
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7e76bff26e7c74902841ca4f607eb0b24a833a4a

TBR=fmalita@google.com,mtklein@google.com,robertphillips@google.com,fmalita@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/722043005
2014-11-19 07:17:17 -08:00
reed
7e76bff26e allow pictures to have a full bounds
BUG=skia:

Review URL: https://codereview.chromium.org/736583004
2014-11-19 06:59:41 -08:00
reed
6be2aa9a25 wip for drawables
Idea:

1. in its mutable recording state, keep a table of drawables on the side, and store an index in the record list.

2. In "immediate-mode" draw, just call the clients drawable directly (need access to our private list to turn the stored index into a proc)

3. when we "snap", we replace the list of drawables with a list of (sub) pictures, and then during playback of the snapped picture, we invoke a private drawable which just calls "drawPicture" on the index'd subpicture.

Review URL: https://codereview.chromium.org/727363003
2014-11-18 11:08:05 -08:00
mtklein
0bd57b2e1e SkVarAlloc::approxBytesAllocated()
This is what I was getting at on the other CL.

BUG=skia:

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

CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-Nexus5-Adreno330-Arm7-Release-Trybot

Review URL: https://codereview.chromium.org/730193003
2014-11-18 09:32:36 -08:00
mtklein
a06a953121 Prune SkRTree
- Propagate a bunch of constant parameters through.
  - Delete code that's not used when bulk loading.
  - Allocate all Nodes together.
  - Stay in SkRect.

Doing a single malloc for the nodes can't not have improved memory usage.

Looks like this might improve record performance ~5%, probably mostly from
staying in SkRects.  This finally dethrones building the BBH as the hot spot.
(Now it's mapping user bounds back to device bounds and adjusting for paints.)

Recording time changes from my MBP:
    desk_rectangletransition.skp	11.5us -> 11.7us	1x
             desk_forecastio.skp	 115us ->  114us	0.98x
                desk_booking.skp	 550us ->  541us	0.98x
            tabl_mercurynews.skp	 176us ->  173us	0.98x
                   tabl_hsfi.skp	 294us ->  287us	0.98x
              desk_wordpress.skp	 351us ->  343us	0.98x
           tabl_worldjournal.skp	 439us ->  426us	0.97x
                  tabl_gmail.skp	20.3us -> 19.7us	0.97x
         desk_youtubetvvideo.skp	10.8us -> 10.4us	0.97x
             desk_googleplus.skp	 1.1ms -> 1.07ms	0.97x
               tabl_slashdot.skp	 106us ->  103us	0.97x
         desk_jsfiddlebigcar.skp	26.7us -> 25.7us	0.96x
               tabl_techmeme.skp	95.4us -> 91.7us	0.96x
             tabl_deviantart.skp	 133us ->  127us	0.96x
              desk_pinterest.skp	40.6us -> 38.9us	0.96x
                 desk_carsvg.skp	 195us ->  187us	0.96x
               tabl_engadget.skp	 376us ->  359us	0.96x
                tabl_sahadan.skp	60.5us -> 57.5us	0.95x
      tabl_culturalsolutions.skp	 255us ->  242us	0.95x
                  tabl_gspro.skp	58.3us -> 55.5us	0.95x
               desk_linkedin.skp	 146us ->  138us	0.94x
                   desk_ebay.skp	 192us ->  181us	0.94x
                    tabl_cnn.skp	 467us ->  440us	0.94x
     desk_jsfiddlehumperclip.skp	29.9us -> 28.1us	0.94x
               desk_tigersvg.skp	43.2us -> 40.5us	0.94x
           desk_yahooanswers.skp	 131us ->  123us	0.94x
desk_googlespreadsheetdashed.skp	1.18ms -> 1.11ms	0.94x
                desk_blogger.skp	 193us ->  181us	0.94x
                tabl_mozilla.skp	1.82ms ->  1.7ms	0.94x
                    tabl_mlb.skp	 145us ->  136us	0.93x
              mobi_wikipedia.skp	 577us ->  539us	0.93x
               tabl_frantzen.skp	54.1us -> 50.4us	0.93x
                  desk_baidu.skp	87.9us -> 81.9us	0.93x
             desk_techcrunch.skp	 224us ->  209us	0.93x
                 desk_sfgate.skp	 206us ->  192us	0.93x
                  tabl_ukwsj.skp	 269us ->  250us	0.93x
               desk_facebook.skp	 316us ->  293us	0.93x
            desk_gmailthread.skp	 205us ->  190us	0.93x
         tabl_googlecalendar.skp	 158us ->  147us	0.93x
                   tabl_digg.skp	 382us ->  354us	0.93x
                 desk_amazon.skp	 106us -> 98.5us	0.93x
          tabl_androidpolice.skp	 693us ->  642us	0.93x
                tabl_nytimes.skp	 206us ->  191us	0.92x
                    desk_gws.skp	 124us ->  114us	0.92x
                desk_youtube.skp	 255us ->  235us	0.92x
           tabl_cuteoverload.skp	 583us ->  537us	0.92x
            desk_oldinboxapp.skp	  18us -> 16.6us	0.92x
             desk_mobilenews.skp	 297us ->  273us	0.92x
                 tabl_pravda.skp	 168us ->  154us	0.92x
              tabl_vnexpress.skp	 236us ->  217us	0.92x
          desk_css3gradients.skp	 202us ->  185us	0.92x
            tabl_gamedeksiam.skp	 508us ->  464us	0.91x
                desk_wowwiki.skp	1.02ms ->  929us	0.91x
                   desk_espn.skp	 209us ->  191us	0.91x
             desk_chalkboard.skp	 315us ->  284us	0.9x
                 desk_mapsvg.skp	 607us ->  543us	0.89x
            desk_pokemonwiki.skp	5.18ms -> 4.62ms	0.89x
               desk_samoasvg.skp	 335us ->  298us	0.89x
        desk_youtubetvbrowse.skp	10.1us -> 8.59us	0.85x
BUG=skia:3085, skia:2834

Review URL: https://codereview.chromium.org/734723002
2014-11-18 09:27:49 -08:00
mtklein
52b7822fa6 Revert of SkVarAlloc::approxBytesAllocated (patchset #5 id:80001 of https://codereview.chromium.org/730193003/)
Reason for revert:
Android needs dlmalloc_usable_size().

Original issue's description:
> SkVarAlloc::approxBytesAllocated()
>
> This is what I was getting at on the other CL.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/f27f1bcce50c8f95aea8469684a70b70c9baee09
>
> CQ_EXTRA_TRYBOTS=Test-Android-Nexus5-Adreno330-Arm7-Release-Trybot

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

Review URL: https://codereview.chromium.org/741443002
2014-11-18 08:15:23 -08:00
mtklein
f27f1bcce5 SkVarAlloc::approxBytesAllocated()
This is what I was getting at on the other CL.

BUG=skia:

Review URL: https://codereview.chromium.org/730193003
2014-11-18 07:24:14 -08:00
joshualitt
9853ccef19 Drawstate on stack
BUG=skia:

Review URL: https://codereview.chromium.org/732693002
2014-11-17 14:22:49 -08:00
robertphillips
f52a063dfd Fix yet another convexicator issue
This CL fixes the case where a bad initial vector (i.e., nearly zero) managed to short circuit all of the convexicator's logic. The initial bad vector would become the last vector and then never get displaced.

The history of this is:

https://codereview.chromium.org/298973004/
Switched the convexicator to not advance the last vector when the cross product wasn't significant

https://codereview.chromium.org/573763002/
Fixed a bug (crbug.com/412640) wherein a zero area path was being incorrectly categorized as convex b.c. opposite but equal vectors were not signaling concavity.

BUG=433683

Review URL: https://codereview.chromium.org/727283003
2014-11-17 12:11:42 -08:00
bsalomon
84c8e62fad Allow GPU resources to not be counted against the cache budget.
BUG=skia:2889

Review URL: https://codereview.chromium.org/721353002
2014-11-17 09:33:27 -08:00
bsalomon
dace19ec17 Correct accounting for wrapped resources
BUG=skia:2889

Review URL: https://codereview.chromium.org/720033004
2014-11-17 07:34:06 -08:00
reed
73c2501120 separate c headers
BUG=skia:

Review URL: https://codereview.chromium.org/728323002
2014-11-17 06:15:42 -08:00
joshualitt
5478d427c6 Push creation of default GP to the caller
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/715903002
2014-11-14 16:00:38 -08:00
scroggo
28562a0199 Fix Android framework build.
When we define SK_BUILD_FOR_ANDROID, we don't define it to anything,
so

    #if SK_BUILD_FOR_ANDROID

is not a meaningful check. Instead, use #ifdef.

TBR=caryclark@google.com, djsollen@google.com

Review URL: https://codereview.chromium.org/728013002
2014-11-14 14:49:34 -08:00
bsalomon
12299ab7a1 Make GrResourceCache2 responsible for calling release, abandon, and ~.
BUG=skia:2889

TBR=robertphillips@google.com

NOTRY=true

Review URL: https://codereview.chromium.org/729683002
2014-11-14 13:33:09 -08:00
bsalomon
71cb0c241e Replace GrResourceCache with GrResourceCache2.
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6

Committed: https://skia.googlesource.com/skia/+/407aa584d183c1bf314f5defd1cf0202e8a96c89

Review URL: https://codereview.chromium.org/716143004
2014-11-14 12:10:15 -08:00
mtklein
d4897591fd Don't pass null to memcmp.
This will allow us to add nonnull-attribute to the UBSAN bot.

We are in fact hitting a case where one of the arguments is null and the other
not, which seems dicey.  I think the scenario is comparing the empty pathref
with another path ref that's just been COWed, without any verbs or points yet.

BUG=skia:

Review URL: https://codereview.chromium.org/732643002
2014-11-14 09:22:40 -08:00
bsalomon
ac49acda52 Revert of Replace GrResourceCache with GrResourceCache2. (patchset #7 id:120001 of https://codereview.chromium.org/716143004/)
Reason for revert:
broken again

Original issue's description:
> Replace GrResourceCache with GrResourceCache2.
>
> BUG=skia:2889
>
> Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6
>
> Committed: https://skia.googlesource.com/skia/+/407aa584d183c1bf314f5defd1cf0202e8a96c89

TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2889

Review URL: https://codereview.chromium.org/726913002
2014-11-14 06:47:39 -08:00
bsalomon
407aa584d1 Replace GrResourceCache with GrResourceCache2.
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6

Review URL: https://codereview.chromium.org/716143004
2014-11-14 06:29:40 -08:00
reed
d54d3fc824 remove unused kLCD_MaskFormat
BUG=skia:

Review URL: https://codereview.chromium.org/728673002
2014-11-13 14:39:58 -08:00
bsalomon
f21dab9540 Revert of Replace GrResourceCache with GrResourceCache2. (patchset #6 id:100001 of https://codereview.chromium.org/716143004/)
Reason for revert:
Breaking stuff

Original issue's description:
> Replace GrResourceCache with GrResourceCache2.
>
> BUG=skia:2889
>
> Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6

TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2889

Review URL: https://codereview.chromium.org/715333003
2014-11-13 13:33:28 -08:00
bsalomon
66a450f21a Replace GrResourceCache with GrResourceCache2.
BUG=skia:2889

Review URL: https://codereview.chromium.org/716143004
2014-11-13 13:19:10 -08:00
mtklein
f2950b1c45 Deparameterize SkVarAlloc.
SkRecord performance is not sensitive to these values, so we can cut some
storage.  This rearranges the space-remaining logic to use a count of bytes
left rather than a pointer to the end, cutting memory usage a little more.

An SkVarAlloc used to weigh 20 or 32 bytes which now becomes 16 or 24.

I think if I think about it a bit more I can trim off that Block* too,
getting us to 12 or 16 bytes.

Because we now just always grow by doubling, this CL switches from storing
fSmallest to its log base 2.  This has the nice effect of never having to worry
about it overflowing, and means we can probably squeeze it down into a byte
if we want, even 6 bits.

BUG=skia:

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

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot

Review URL: https://codereview.chromium.org/721313002
2014-11-13 12:41:14 -08:00
caryclark
912c9ec6ee disable a couple of new fuzz378 tests on android
these tests fail on a nexus 9 in release only. It's probably related
to the fused multiply-add instruction

TBR=

Review URL: https://codereview.chromium.org/722303002
2014-11-13 11:08:52 -08:00
caryclark
65f553182a These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
The fixes include
- detect when finding the active top loops between two possible answers
- preflight chasing winding to ensure answer is consistent
- binary search more often when quadratic intersection fails
- add more failure paths when an intersect is missed

While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.

TBR=
BUG=421132

Committed: https://skia.googlesource.com/skia/+/6f726addf3178b01949bb389ef83cf14a1d7b6b2

Review URL: https://codereview.chromium.org/633393002
2014-11-13 06:58:52 -08:00
bsalomon
69ed47f42d Make GrGpuResource::gpuMemorySize non-virtual w/ onGpuMemorySize virtual impl
BUG=skia:2889

Review URL: https://codereview.chromium.org/702413003
2014-11-12 11:13:39 -08:00
mtklein
703d3c7093 Followup: remove unnecessary SkTRefArray
BUG=skia:

Review URL: https://codereview.chromium.org/719113004
2014-11-12 11:08:20 -08:00
bsalomon
48ea202817 set key data in duplicate scratch key unit test
TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/722763002
2014-11-12 10:28:17 -08:00
mtklein
391e318b3d Fix memory leak in BitmapHeapTest
BUG=skia:

Review URL: https://codereview.chromium.org/715383003
2014-11-12 10:09:11 -08:00
mtklein
88300a555f Follow up.
BUG=skia:

Review URL: https://codereview.chromium.org/719853002
2014-11-12 09:38:21 -08:00
robertphillips
8236591547 Rename GrAccelData to SkLayerInfo and move it to src/core
Review URL: https://codereview.chromium.org/719133002
2014-11-12 09:32:34 -08:00
mtklein
a74ce853c8 Start stripping out complicated parts of SkPicture{Record,Data}.
First step: no more paint flattening or deduplication.

BUG=skia:

Review URL: https://codereview.chromium.org/723593002
2014-11-12 09:19:02 -08:00
egdaniel
605dd0fbce Move GrInvariantOutput out of GrProcessor and into its own class.
This will help with the ability to subclass, add to, etc. GrInvariantOutput. Also it was simply
getting a little too big to be a "supporting" subclass
BUG=skia:

Review URL: https://codereview.chromium.org/699943003
2014-11-12 08:35:25 -08:00
mtklein
ef09991255 Add more tests.
BUG=skia:

Review URL: https://codereview.chromium.org/717143003
2014-11-12 07:27:01 -08:00
robertphillips
4e8e3421aa Move SkRecordComputeLayers and CollectLayers into SkRecordDraw.cpp
Rather then exposing parts of FillBounds (as in Expose FillBounds to allow GrPictureUtils::CollectLayers to be layered on top of it - https://codereview.chromium.org/698643002/), this CL moves CollectLayers into SkRecordDraw.cpp to accomplish the layering.

Review URL: https://codereview.chromium.org/716913003
2014-11-12 06:46:08 -08:00
mtklein
ad8aa1dcf3 Clang incorrectly thinks this typedef is unused.
BUG=skia:3059

Review URL: https://codereview.chromium.org/715093003
2014-11-11 18:52:02 -08:00
bsalomon
453cf40ac7 Add GrGpuResource::CacheAccess
Internal only helper class for manipulating and accessing cache keys.

BUG=skia:2889

Review URL: https://codereview.chromium.org/703303003
2014-11-11 14:15:57 -08:00
reed
f539b8cdee modify nothingToDraw to notice filters
This reverts commit c71ffd4e76.

TBR=

Review URL: https://codereview.chromium.org/683003003
2014-11-11 12:51:33 -08:00
mtklein
c71ffd4e76 Revert of modify nothingToDraw to notice filters (patchset #1 id:1 of https://codereview.chromium.org/717753002/)
Reason for revert:
modecolorfilters, perhaps more changed

Original issue's description:
> modify nothingToDraw to notice filters
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d5688c509293a450c058e0cc1f4673be2931bb5c

TBR=djsollen@google.com,reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/717813002
2014-11-11 12:13:16 -08:00
reed
d5688c5092 modify nothingToDraw to notice filters
BUG=skia:

Review URL: https://codereview.chromium.org/717753002
2014-11-11 11:00:55 -08:00
bsalomon
6d4488c5e0 Remove all knowledge of resource keys from the legacy cache.
BUG=skia:2889

Review URL: https://codereview.chromium.org/705413002
2014-11-11 07:27:16 -08:00
mtklein
5da116f920 start again on Sk4x with portable version and unit tests
work on tests

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-ASAN-Trybot,Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot,Test-Win7-ShuttleA-HD2000-x86_64-Debug-Trybot,Test-Win7-ShuttleA-HD2000-x86-Debug-Trybot
BUG=skia:

Review URL: https://codereview.chromium.org/704923003
2014-11-11 06:16:42 -08:00
robertphillips
81f71b6630 Change where layer hoisting data is gathered
This CL:
1) removes the EXPERIMENTAL_optimize on SkCanvas & SkDevice
2) moves the saveLayer gathering step to endRecording
3) Replaces GPUOptimize with SkRecordComputeLayers
4) Update bench_pictures & render_pictures to provide the new flag

#2 also necessitated moving the BBH computation (and record optimization) out of SkPicture's ctor (and into endRecording)

Review URL: https://codereview.chromium.org/718443002
2014-11-11 04:54:49 -08:00
halcanary
ac6c4fc524 tests/Time.cpp: more verbose errors
Review URL: https://codereview.chromium.org/711143002
2014-11-10 14:39:24 -08:00
scroggo
b61e206138 Add tests (and fix!) for known bad ICO files.
We previously saw crashes decoding bad ICO files. Add tests for
known bad files.

While testing, I learned that one of them still crashes. Check for
large offset and size separately to fix the crash.

BUG=skia:2878

Review URL: https://codereview.chromium.org/712123002
2014-11-10 13:12:25 -08:00
bsalomon
8b79d23f82 Use GrResourceCache2 to service content key lookups
BUG=skia:2889

Review URL: https://codereview.chromium.org/707493002
2014-11-10 10:19:06 -08:00
halcanary
8e74b1565c Fix SkTime::GetDateTime Posix implementation, add unit test.
The year was off by 1900

Review URL: https://codereview.chromium.org/714633002
2014-11-10 09:20:22 -08:00
reed
7c74885e01 flag imageinfo as srgb
intended uses:
- flag a SkSurface as sRGB (only supported by Ganesh for now)
- flag images (e.g. png or jpeg) as sRGB if the codec tells us that

wins:
- faster gamma-correct text (esp. w/ distance-fields) when we can use sRGB for text
- better color fidelity when the screen really is sRGB

Review URL: https://codereview.chromium.org/676883003
2014-11-10 08:57:21 -08:00
tfarina
a71d3af100 Cleanup: Use SkAutoGraphics in gm and tests.
BUG=None
R=bsalomon@google.com

Review URL: https://codereview.chromium.org/704413002
2014-11-07 06:12:30 -08:00
scroggo
0ee2627026 When running DM, write test failures to json.
Add skiatest::Failure to keep track of data about a test failure.

Reporter::reportFailed and ::onReportFailed now take Failure as a
parameter. This allows the implementation to treat the failure as it
wishes. Provide a helper to format the failure the same as prior to
the change.

Update the macros for calling reportFailed (REPORTER_ASSERT etc) to
create a Failure object.

Convert a direct call to reportFailed to the macro ERRORF.

Write Failures to Json.
Sample output when running dm on the dummy test crrev.com/705723004:
{
   "test_results" : {
      "failures" : [
         {
            "condition" : "0 > 3",
            "file_name" : "../../tests/DummyTest.cpp",
            "line_no" : 10,
            "message" : ""
         },
         {
            "condition" : "false",
            "file_name" : "../../tests/DummyTest.cpp",
            "line_no" : 4,
            "message" : ""
         },
         {
            "condition" : "1 == 3",
            "file_name" : "../../tests/DummyTest.cpp",
            "line_no" : 5,
            "message" : "I can too count!"
         },
         {
            "condition" : "",
            "file_name" : "../../tests/DummyTest.cpp",
            "line_no" : 6,
            "message" : "seven is 7"
         },
         {
            "condition" : "1 == 3",
            "file_name" : "../../tests/DummyTest.cpp",
            "line_no" : 14,
            "message" : "I can too count!"
         }
      ]
   }
}

Report all of the failures from one test.
Previously, if one test had multiple failures, only one was reportered.
e.g:

Failures:
  test Dummy: ../../tests/DummyTest.cpp:6   seven is 7
  test Dummy2: ../../tests/DummyTest.cpp:10 0 > 3
  test Dummy3: ../../tests/DummyTest.cpp:14 I can too count!: 1 == 3
3 failures.

Now, we get all the messages:

Failures:
  test Dummy: ../../tests/DummyTest.cpp:4   false
        ../../tests/DummyTest.cpp:5 I can too count!: 1 == 3
        ../../tests/DummyTest.cpp:6 seven is 7
  test Dummy2: ../../tests/DummyTest.cpp:10 0 > 3
  test Dummy3: ../../tests/DummyTest.cpp:14 I can too count!: 1 == 3
3 failures.

(Note that we still state "3 failures" because 3 DM::Tasks failed.)

BUG=skia:3082
BUG=skia:2454

Review URL: https://codereview.chromium.org/694703005
2014-11-07 06:07:32 -08:00
joshualitt
2c93efeb6f Clip in grdrawtarget
NOTREECHECKS=true
BUG=skia:

Review URL: https://codereview.chromium.org/685883003
2014-11-06 12:57:13 -08:00
bsalomon
3343557421 Add mock context and use in ResourceCacheTest.
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/820dd6c335411aad889c1d7e8a857642ecd87e30

Review URL: https://codereview.chromium.org/702083003
2014-11-05 14:47:42 -08:00
bsalomon
fdcf2c0863 Revert of Add mock context and use in ResourceCacheTest. (patchset #4 id:60001 of https://codereview.chromium.org/702083003/)
Reason for revert:
Breaking tests

Original issue's description:
> Add mock context and use in ResourceCacheTest.
>
> BUG=skia:2889
>
> Committed: https://skia.googlesource.com/skia/+/820dd6c335411aad889c1d7e8a857642ecd87e30

TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2889

Review URL: https://codereview.chromium.org/704563004
2014-11-05 12:30:32 -08:00
bsalomon
820dd6c335 Add mock context and use in ResourceCacheTest.
BUG=skia:2889

Review URL: https://codereview.chromium.org/702083003
2014-11-05 12:09:45 -08:00
robertphillips
2b9ee63c24 Add unit test for SkDashPathEffect::asPoints' culling
This is a follow on to (Crop the fast path dashed lines to the cull rect - https://codereview.chromium.org/699623003/)

Review URL: https://codereview.chromium.org/701133002
2014-11-05 08:06:40 -08:00
bungeman
4b86bacb04 Allow all font weights on Android and respect overrides.
This removes the code which forces 400 and 700 weights only,
and also overrides the font weight with the configured weight.

Review URL: https://codereview.chromium.org/694533006
2014-11-04 10:54:32 -08:00
jvanverth
d86b07a8ff Fix PictureTest for new GPU veto
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/702733002
2014-11-04 08:50:16 -08:00
egdaniel
37b4d866b1 Force input coverage to be only a byte in gpu shaders.
Prime coverage invariant output calculations with single component

BUG=skia:

Review URL: https://codereview.chromium.org/649783003
2014-11-03 10:07:07 -08:00
robertphillips
4d52afef5c Shrink saveLayer device bounds when it supplies an explicit bounds and has a complex paint
This CL shrinks the bound computed for saveLayers that possess both an explicit
bound and a complex paint (e.g., one that affects transparent black). In this
case the bound of the layer should be the clipped explicit bound rather then
the clip prior/after the saveLayer/restore block.

In the following the first bound is the currently computed bound
while the second is the new/desired one:

For a 100x100 picture

saveLayer (no bound, no paint) [ 0 0 100 100 ]  [ 50 50 100 100 ]
  setMatrix (translate 50, 50) [ 0 0 100 100 ] [ 50 50 100 100 ]
  saveLayer (bound of 0, 0, 50, 50 - complex paint) [ 0 0 100 100 ] [ 50 50 100 100 ]
  restore [ 0 0 100 100 ] [ 50 50 100 100 ]
restore [ 0 0 100 100 ] [ 50 50 100 100 ]

Review URL: https://codereview.chromium.org/696763002
2014-11-03 08:19:44 -08:00
robertphillips
d8aa7b74c8 Upgrade GPUOptimize
This will be a bit hairy to review.

The FillBounds and CollectLayers code has diverged significantly resulting in the rendering path seeing different bounds than the hoisting path. This CL merges the FillBounds changes into CollectLayers. A follow on CL will, hopefully, find a way to layer CollectLayers on top of FillBounds.

The only code in CollectLayers that is different from FillBounds is bracketed by "LAYER HOISTING" comments.

NOTREECHECKS=true

Review URL: https://codereview.chromium.org/685263004
2014-10-30 16:45:02 -07:00
junov
a41d3c33bc Make RTree handle the case where the playback canvas has empty clip bounds
BUG=skia:3074

Review URL: https://codereview.chromium.org/678303004
2014-10-30 11:44:20 -07:00
reed
f037e0bf13 allow SkUserConfig.h to control NOGPU
BUG=skia:

Review URL: https://codereview.chromium.org/685243002
2014-10-30 11:34:15 -07:00
joshualitt
7a6184fdf7 cleanup reentrance logic in CMM
BUG=skia:

Review URL: https://codereview.chromium.org/684223002
2014-10-29 18:29:27 -07:00
mtklein
ed167acb7b Revert of Use SkTypeface::getBounds() in bounding-box calculations. (patchset #5 id:80001 of https://codereview.chromium.org/680363003/)
Reason for revert:
Mac mini asserting

Original issue's description:
> Use SkTypeface::getBounds() in bounding-box calculations.
>
> This should produce tighter conservative bounding boxes for text than the
> approximation code it replaces.
>
> Recording performance is neutral on my desktop.  Playback performance
> improves by up to 15% on text heavy pages, e.g.
>
>   desk_pokemonwiki.skp_1 3.24ms -> 2.83ms  0.87x
>         desk_baidu.skp_1 1.91ms -> 1.58ms  0.83x
>
> Committed: https://skia.googlesource.com/skia/+/bf8dc343df4fbdcb8af546eb68b640e011a33489
>
> CQ_EXTRA_TRYBOTS=client.skia:Test-Win7-ShuttleA-HD2000-x86-Debug-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/c51add674dfb89b988a7fbc05f41838c203f9dcd

TBR=reed@google.com,mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/690833002
2014-10-29 16:07:11 -07:00
mtklein
c51add674d Use SkTypeface::getBounds() in bounding-box calculations.
This should produce tighter conservative bounding boxes for text than the
approximation code it replaces.

Recording performance is neutral on my desktop.  Playback performance
improves by up to 15% on text heavy pages, e.g.

  desk_pokemonwiki.skp_1 3.24ms -> 2.83ms  0.87x
        desk_baidu.skp_1 1.91ms -> 1.58ms  0.83x

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

CQ_EXTRA_TRYBOTS=client.skia:Test-Win7-ShuttleA-HD2000-x86-Debug-Trybot

Review URL: https://codereview.chromium.org/680363003
2014-10-29 15:36:38 -07:00
robertphillips
4ab5a9048c Discard atlas after every MultiPictureDraw::draw
This is intended to prevent ghosting on tiled architectures.

This CL also defers creation of the atlas (and its texture) until it is actually needed.

Committed: https://skia.googlesource.com/skia/+/6d5b5455743414ddb11d2b8c1fe9d7959f2b853d

Review URL: https://codereview.chromium.org/678403002
2014-10-29 13:56:03 -07:00
reed
89889b6939 MultiPictureDraw is taskgroup aware.
SampleApp is multipicturedraw aware.

BUG=skia:

Review URL: https://codereview.chromium.org/684923002
2014-10-29 12:36:45 -07:00
senorblanco
8f3937d9fc Fix bounds computation of all 0-input filters.
The SkRectShaderImageFilter had the same bug as previously fixed for
SkBitmapSource and SkPictureImageFilter. Rather than copy-and-paste
the implementation, this change makes all filters with 0 inputs return
their source bounds, instead of returning false.

BUG=427251

Review URL: https://codereview.chromium.org/681643003
2014-10-29 12:36:32 -07:00
mtklein
27f965a577 Revert of Use SkTypeface::getBounds() in bounding-box calculations. (patchset #3 id:40001 of https://codereview.chromium.org/680363003/)
Reason for revert:
http://build.chromium.org/p/client.skia/builders/Test-Win7-ShuttleA-HD2000-x86-Debug/builds/97/steps/nanobench/logs/stdio

Original issue's description:
> Use SkTypeface::getBounds() in bounding-box calculations.
>
> This should produce tighter conservative bounding boxes for text than the
> approximation code it replaces.
>
> Recording performance is neutral on my desktop.  Playback performance
> improves by up to 15% on text heavy pages, e.g.
>
>   desk_pokemonwiki.skp_1 3.24ms -> 2.83ms  0.87x
>         desk_baidu.skp_1 1.91ms -> 1.58ms  0.83x
>
> Committed: https://skia.googlesource.com/skia/+/bf8dc343df4fbdcb8af546eb68b640e011a33489

TBR=reed@google.com,mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/685173002
2014-10-29 08:33:38 -07:00
mtklein
bf8dc343df Use SkTypeface::getBounds() in bounding-box calculations.
This should produce tighter conservative bounding boxes for text than the
approximation code it replaces.

Recording performance is neutral on my desktop.  Playback performance
improves by up to 15% on text heavy pages, e.g.

  desk_pokemonwiki.skp_1 3.24ms -> 2.83ms  0.87x
        desk_baidu.skp_1 1.91ms -> 1.58ms  0.83x

Review URL: https://codereview.chromium.org/680363003
2014-10-29 08:12:08 -07:00
joshualitt
79f8faeea2 OptState owns program descriptor
BUG=skia:

Review URL: https://codereview.chromium.org/674543004
2014-10-28 17:59:26 -07:00
bsalomon
f2703d83da rename GrTextureDesc->GrSurfaceDesc, GrTextureFlags->GrSurfaceFlags
Review URL: https://codereview.chromium.org/682223002
2014-10-28 14:33:06 -07:00
piotaixr
5ae89d1fa8 Removing dead code from CanvasTest
BUG=skia:3054

Review URL: https://codereview.chromium.org/681083002
2014-10-28 11:13:59 -07:00
hcm
27c46a08a9 Revert of harden pathops for pathological test (patchset #19 id:410001 of https://codereview.chromium.org/633393002/)
Reason for revert:
Compile errors on bots

Original issue's description:
> These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
>
> The fixes include
> - detect when finding the active top loops between two possible answers
> - preflight chasing winding to ensure answer is consistent
> - binary search more often when quadratic intersection fails
> - add more failure paths when an intersect is missed
>
> While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.
>
> TBR=
> BUG=421132
>
> Committed: https://skia.googlesource.com/skia/+/6f726addf3178b01949bb389ef83cf14a1d7b6b2

TBR=caryclark@google.com
NOTREECHECKS=true
NOTRY=true
BUG=421132

Review URL: https://codereview.chromium.org/686843002
2014-10-28 10:55:54 -07:00
caryclark
6f726addf3 These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
The fixes include
- detect when finding the active top loops between two possible answers
- preflight chasing winding to ensure answer is consistent
- binary search more often when quadratic intersection fails
- add more failure paths when an intersect is missed

While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.

TBR=
BUG=421132

Review URL: https://codereview.chromium.org/633393002
2014-10-28 10:33:09 -07:00
robertphillips
fd61ed0d79 Alter layer hoisting to only hoist layers for one canvas at a time
This CL alters layer hoisting to defer creation of the free floating layers until they are actually needed (rather than creating _all_ the hoisted layers at the start).

It also fixes a pre vs. post Concat bug with how matrices were being accumulated.

BUG=skia:2315

Review URL: https://codereview.chromium.org/657383004
2014-10-28 07:21:44 -07:00
reed
15c746062e not a failure if we didn't load the test file
BUG=skia:

Review URL: https://codereview.chromium.org/687453005
2014-10-28 07:12:37 -07:00
hcm
d0f1969100 Revert of Fix bounds computation of all 0-input filters. (patchset #2 id:20001 of https://codereview.chromium.org/681643003/)
Reason for revert:
try again

Original issue's description:
> Fix bounds computation of all 0-input filters.
>
> The SkRectShaderImageFilter had the same bug as previously fixed for
> SkBitmapSource and SkPictureImageFilter. Rather than copy-and-paste
> the implementation, this change makes all filters with 0 inputs return
> their source bounds, instead of returning false.
>
> BUG=427251
>
> Committed: https://skia.googlesource.com/skia/+/ba036cc82b5a543a13cafd11a19ba0e3087fca38

TBR=bsalomon@google.com,senorblanco@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=427251

Review URL: https://codereview.chromium.org/678273002
2014-10-27 20:55:01 -07:00
piotaixr
76993edbe5 Reenable assertions that were reported failing in tests/CanvasTest.cpp
BUG=skia:498,skia:499

Review URL: https://codereview.chromium.org/670403002
2014-10-27 15:31:34 -07:00
senorblanco
ba036cc82b Fix bounds computation of all 0-input filters.
The SkRectShaderImageFilter had the same bug as previously fixed for
SkBitmapSource and SkPictureImageFilter. Rather than copy-and-paste
the implementation, this change makes all filters with 0 inputs return
their source bounds, instead of returning false.

BUG=427251

Review URL: https://codereview.chromium.org/681643003
2014-10-27 13:38:13 -07:00
mtklein
4477c3c0e6 Cut down SkBBH API more.
- The expected case is now a single bulk-load insert() call instead of N;
  - reserve() and flushDeferredInserts() can fold into insert() now;
  - SkBBH subclasses may take ownership of the bounds

This appears to be a performance no-op on both my Mac and N5.  I guess
even the simplest indirect branch predictor ("same as last time") can predict
the repeated virtual calls to SkBBH::insert() perfectly.

BUG=skia:

Review URL: https://codereview.chromium.org/670213002
2014-10-27 10:27:10 -07:00
halcanary
f622a6c8fd Add SkIRect bounds() convenience method to SkImageInfo and SkBitmap.
Review URL: https://codereview.chromium.org/646213003
2014-10-24 12:54:53 -07:00
reed
e332396d2f move c api into include
BUG=skia:

Review URL: https://codereview.chromium.org/665203004
2014-10-24 11:16:19 -07:00
scroggo
3ceef9a66a Add test for new FrontBufferedStream behavior.
Test for https://skia.googlesource.com/skia/+/dd5a1e094c19fa10202c37c50a1f799e5af5dac0

Verify that FrontBufferedStream does not attempt to read beyond the
end of its underlying stream.

Make SkStreamToCGImageSource handle an empty stream better.

Review URL: https://codereview.chromium.org/641813009
2014-10-24 06:55:07 -07:00
sugoi
234f036b3e Adding an option to render only the shadow in SkDropShadowImageFilter
This is basically how blink uses the filter. Currently, I can't use it for "ShadowOnly" mode with the filter at all, but instead of copying the code and risking to have the codepaths diverge, I'm simply going to add the option here.

BUG=skia:

Review URL: https://codereview.chromium.org/646213004
2014-10-23 13:59:52 -07:00
pavel
47eedcc848 Add utils to better quantize grayscale values to three bit indices while
compressing coverage masks.

Signed-off-by: Pavel Krajcevski <pavel@cs.unc.edu>

BUG=skia:

Review URL: https://codereview.chromium.org/669243003
2014-10-23 13:18:50 -07:00
caryclark
08fa28cd31 add float equivalent in dumpHex output as comment
R=reed@google.com,bsalomon@google.com

Review URL: https://codereview.chromium.org/676803002
2014-10-23 13:08:57 -07:00
reed
4dca7a8296 use SkMaskCache inside SkBlurMaskFilter
depends on https://codereview.chromium.org/670063004/

BUG=skia:

Review URL: https://codereview.chromium.org/669993003
2014-10-23 12:42:46 -07:00
mtklein
404eb87993 Revert of Add test for new FrontBufferedStream behavior. (patchset #1 id:1 of https://codereview.chromium.org/641813009/)
Reason for revert:
Test is SkASSERTing on Macs, e.g:

http://chromegw.corp.google.com/i/client.skia/builders/Test-Mac10.6-MacMini4.1-GeForce320M-x86_64-Debug/builds/257/steps/dm/logs/stdio

210 tasks left	1737M peak	    1ms	test FrontBufferedStream../../src/ports/SkImageDecoder_CG.cpp:43: failed assertion "data"

Signal 11:
_sigtramp (+0x1a)
SkStreamToCGImageSource(SkStream*) (+0x62)
SkImageDecoder_CG::onDecode(SkStream*, SkBitmap*, SkImageDecoder::Mode) (+0x2e)
SkImageDecoder::decode(SkStream*, SkBitmap*, SkColorType, SkImageDecoder::Mode) (+0x81)
SkImageDecoder::DecodeStream(SkStreamRewindable*, SkBitmap*, SkColorType, SkImageDecoder::Mode, SkImageDecoder::Format*) (+0xff)
SkImageDecoder::DecodeStream(SkStreamRewindable*, SkBitmap*) (+0x31)
test_ShortFrontBufferedStream(skiatest::Reporter*) (+0x97)
skiatest::ShortFrontBufferedStreamClass::onRun(skiatest::Reporter*) (+0x19)
skiatest::Test::run() (+0x7c)
DM::CpuTestTask::draw() (+0x5a)
DM::CpuTask::run() (+0x9e)
non-virtual thunk to DM::CpuTask::run() (+0x1c)
(anonymous namespace)::ThreadPool::Loop(void*) (+0xf4)
thread_start(void*) (+0x54)
_pthread_start (+0x14b)

Original issue's description:
> Add test for new FrontBufferedStream behavior.
>
> Test for https://skia.googlesource.com/skia/+/dd5a1e094c19fa10202c37c50a1f799e5af5dac0
>
> Verify that FrontBufferedStream does not attempt to read beyond the
> end of its underlying stream.
>
> Committed: https://skia.googlesource.com/skia/+/da59f05c6738dbb9a92cad21c608cdfae53a76b2

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

Review URL: https://codereview.chromium.org/649553003
2014-10-23 12:08:03 -07:00
piotaixr
ec6e670669 Removed simple tests steps from CanvasTest.
CanvasTest only checks if the state of the different canvas
implementations are consistent with the one of the default
implementation.

Because most of the draw calls are stateless and already tested in GMs
the test steps that exercices them are not useful.

BUG=skia:3054

Review URL: https://codereview.chromium.org/672273002
2014-10-23 10:59:07 -07:00
djsollen
e3aee8fb7b Remove android specific genID from SkPaint.
Review URL: https://codereview.chromium.org/677453002
2014-10-23 10:23:07 -07:00
scroggo
da59f05c67 Add test for new FrontBufferedStream behavior.
Test for https://skia.googlesource.com/skia/+/dd5a1e094c19fa10202c37c50a1f799e5af5dac0

Verify that FrontBufferedStream does not attempt to read beyond the
end of its underlying stream.

Review URL: https://codereview.chromium.org/641813009
2014-10-23 10:21:28 -07:00
qiankun.miao
d9aac34ece Add SkMaskCache
BUG=skia:

Review URL: https://codereview.chromium.org/670063004
2014-10-23 07:58:17 -07:00
scroggo
2a1208017d Qualify the return value of SkImageDecoder::decode
Add a new enum to differentiate between a complete decode and a
partial decode (with the third value being failure). Return this
value from SkImageDecoder::onDecode (in all subclasses, plus
SkImageDecoder_empty) and ::decode.

For convenience, if the enum is treated as a boolean, success and
partial success are both considered true.

Note that the static helper functions (DecodeFile etc) still return
true and false (for one thing, this allows us to continue to use
SkImageDecoder::DecodeMemory as an SkPicture::InstallPixelRefProc in
SkPicture::CreateFromStream).

Also correctly report failure in SkASTCImageDecoder::onDecode when
SkTextureCompressor::DecompressBufferFromFormat fails.

BUG=skia:3037
BUG:b/17419670

Review URL: https://codereview.chromium.org/647023006
2014-10-22 12:07:00 -07:00
fmalita
171e5b73a8 SkResourceCache::Key namespace support.
Add a unique-per-subclass namespace tag to make Keys from different
domains comparable.

Also drop the SkPictureShader cache and convert to using the global
resource cache instead.

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

Review URL: https://codereview.chromium.org/668223002
2014-10-22 11:20:40 -07:00
robertphillips
9e6835da41 Track nested picture xform state for layer hoisting
The accumulated matrix state of any enclosing SkPictures must be stored separate from the picture-local CTM. Any setMatrix calls inside a layer need to replace the picture-local CTM but concatenate with the enclosing SkPicture transform state (and the transform state needed to translate the layer to the correct location in the cached GrTexture).

Review URL: https://codereview.chromium.org/639863005
2014-10-22 05:33:52 -07:00
reed
39393e3ac3 add round/ceil/etc. for SkMScalar
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/645793006
2014-10-21 12:33:21 -07:00
mtklein
e9e0dea15b SkLazyPtr follow ups
- moves test to LazyPtrTest.cpp
 - adds the ability to use a Create() method with an argument

BUG=skia:

Review URL: https://codereview.chromium.org/669783002
2014-10-21 12:20:04 -07:00
senorblanco
b0e89dcc1d Fix image filters for PDF backend.
Currently, the PDF backend does not support image filters (since PDF
does not have that functionality), so it simply removes them. This is
causing Chrome print preview to render incorrectly (see bug). The fix
here is to fall back to a raster device for image filters, as we used
to do in Blink. The resulting bitmap will be drawn to the destination
device as a normal main-memory-backed bitmap.

Note: this change invalidates the PDF results of all GMs containing
image filters (since they'll actually be rendered).

BUG=422144

Review URL: https://codereview.chromium.org/644323006
2014-10-20 14:03:13 -07:00
mtklein
1d932663e1 SkLazyPtr suitable as a local or class member.
BUG=skia:

Review URL: https://codereview.chromium.org/653183006
2014-10-20 13:46:11 -07:00
mtklein
41966d49b0 Dilate approximated text bounds to squelch recent assertion failure.
This is once again an issue related to logo fonts, so I don't
see any easy way to add a regression test for this.

BUG=424824

Review URL: https://codereview.chromium.org/665103002
2014-10-20 13:44:24 -07:00
robertphillips
3aac6e0848 Add clip to layer cache
This CL adds the clip region to the GPU layer hoisting image cache. It also switches back to the old caching behavior of using the entire CTM in the cache key rather then just the upper 2x2. This latter change is to focus more on hoisting rather then caching.

It also includes 2 smaller fixes:
a) layer's that have an image filter are no longer atlased (b.c. doing so complicates applying the image filter)

b) the result of clipping the layer's bounds to the current clip is used as the hoisted layer's size. This reduces the amount of pixels drawn to match a normal (non-hoisted) draw pass.

Review URL: https://codereview.chromium.org/640773004
2014-10-20 08:52:40 -07:00
mtklein
a71aee6afd Remove obsolete SkRecording.
Can land after https://codereview.chromium.org/664583002/ does.

BUG=skia:

Only API removed.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/660903002
2014-10-20 06:44:58 -07:00
sugoi
b227e37eae JPEG YUV Decoding
Enabling JPEG YUV Decoding in Skia

BUG=skia:3005, skia:1674, skia:3029

Committed: https://skia.googlesource.com/skia/+/8e6c3b93a39e19111662a760ede97df55e51d39f

Review URL: https://codereview.chromium.org/399683007
2014-10-16 13:10:57 -07:00
piotaixr
65151754b9 Override SkCanvas::drawImage() in SkRecorder.
BUG=skia:2947

Review URL: https://codereview.chromium.org/610003002
2014-10-16 11:58:39 -07:00
kkinnunen
30bc88ccd5 Refactor SkGLContext to be actually extendable
Refactor SkGLContext to be actually extendable. Before, non-trivial subclass
would need to destroy the GL connection upon running the destructor. However,
the base class would run GL commands in its own destructor (with destroyed GL
connection)

Refactor so that SkGLContext subclass object creation is completely done by
the factory function. If the factory function returns a non-NULL ptr, it means the context
is usable.

The destruction is done with the destructor instead of virtual function called
upon destruction. Make the destructors not to call virtual functions, for
clarity.

Remove custom 1x1 FBO setup code from the base class. It appears not to be used
anymore.

BUG=skia:2992

Review URL: https://codereview.chromium.org/640283004
2014-10-15 23:03:54 -07:00
egdaniel
9e4d6d180f Move willUseInputColor check to computeInvariantOutput
BUG=skia:

Review URL: https://codereview.chromium.org/656503002
2014-10-15 13:49:02 -07:00
cdalton
6819df3644 Adds a GrTRecorder class that GrInOrderDrawBuffer uses to allocate
all its commands interleaved in contiguous memory. GrTRecorder also
supports extra data associated with objects, so we can store arrays
inline without having to call malloc().

Committed: https://skia.googlesource.com/skia/+/360b6801cfd90485891d709e44cf395d527ba69e

Review URL: https://codereview.chromium.org/628453002
2014-10-15 13:43:48 -07:00
rmistry
3ac569b37a Revert of JPEG YUV Decoding (patchset #5 id:180001 of https://codereview.chromium.org/399683007/)
Reason for revert:
Caused many test bots to go red:
http://build.chromium.org/p/client.skia/builders/Test-ChromeOS-Alex-GMA3150-x86-Release/builds/22/steps/dm/logs/stdio
http://build.chromium.org/p/client.skia/builders/Test-ChromeOS-Link-HD4000-x86_64-Debug/builds/168/steps/dm/logs/stdio
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX660-x86-Release/builds/38/steps/dm/logs/stdio

Original issue's description:
> JPEG YUV Decoding
>
> Enabling JPEG YUV Decoding in Skia
>
> BUG=skia:3005, skia:1674
>
> Committed: https://skia.googlesource.com/skia/+/8e6c3b93a39e19111662a760ede97df55e51d39f

TBR=reed@google.com,scroggo@google.com,sugoi@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:3005, skia:1674

Review URL: https://codereview.chromium.org/656163002
2014-10-15 13:15:58 -07:00
bsalomon
98b33ebe6f Some cleanup in processor header files.
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/659803004
2014-10-15 11:05:26 -07:00
sugoi
8e6c3b93a3 JPEG YUV Decoding
Enabling JPEG YUV Decoding in Skia

BUG=skia:3005, skia:1674

Review URL: https://codereview.chromium.org/399683007
2014-10-15 11:04:18 -07:00
bsalomon
6251d17dfa Split GrFragmentProcessor into its own header
Review URL: https://codereview.chromium.org/660573002
2014-10-15 10:50:36 -07:00
reed
bcba2c9f9f interesct path bounds with clip bounds before initializing supersampler
BUG=skia:

Review URL: https://codereview.chromium.org/656473004
2014-10-15 08:52:00 -07:00
bsalomon
0e08fc17e4 Push isEqual/onIsEqual down from GrProcessor to subclasses.
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/654273002
2014-10-15 08:19:04 -07:00
reed
157f36d358 add tests for large cordinates bounds when building aaclip
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/658753002
2014-10-15 07:05:09 -07:00
mtklein
f439c77e9c Revert of Create a single command buffer for GrInOrderDrawBuffer (patchset #17 id:1240001 of https://codereview.chromium.org/628453002/)
Reason for revert:
Leaking memory:
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/9/steps/gm/logs/stdio

Original issue's description:
> Adds a GrTRecorder class that GrInOrderDrawBuffer uses to allocate
> all its commands interleaved in contiguous memory. GrTRecorder also
> supports extra data associated with objects, so we can store arrays
> inline without having to call malloc().
>
> Committed: https://skia.googlesource.com/skia/+/360b6801cfd90485891d709e44cf395d527ba69e

TBR=bsalomon@google.com,reed@google.com,cdalton@nvidia.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/654863003
2014-10-14 14:29:30 -07:00
cdalton
360b6801cf Adds a GrTRecorder class that GrInOrderDrawBuffer uses to allocate
all its commands interleaved in contiguous memory. GrTRecorder also
supports extra data associated with objects, so we can store arrays
inline without having to call malloc().

Review URL: https://codereview.chromium.org/628453002
2014-10-14 11:53:05 -07:00
bsalomon
e30597375c Remove uses of GrAutoScratchTexture.
Rename GrContext::lockAndRefScratchTexture to refScratchTexture.

GrSurface::writePixels returns bool instead of void.

BUG=skia:2889

Review URL: https://codereview.chromium.org/638403003
2014-10-14 11:47:22 -07:00
mtklein
07894c4d7d Revert of Create a single command buffer for GrInOrderDrawBuffer (patchset #14 id:1050001 of https://codereview.chromium.org/628453002/)
Reason for revert:
New test failing on Android: http://build.chromium.org/p/client.skia.android/builders/Test-Android-Nexus7-Tegra3-Arm7-Release/builds/89/steps/dm/logs/stdio

Original issue's description:
> Adds a GrTBaseList class that GrInOrderDrawBuffer uses to allocate
> all its commands interleaved in contiguous memory. GrTBaseList also
> supports extra data associated with objects, so we can store arrays
> inline without having to call malloc().
>
> Committed: https://skia.googlesource.com/skia/+/47c844aaba81e5a29c773b660e1d6062c766d253

TBR=bsalomon@google.com,reed@google.com,cdalton@nvidia.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/652843002
2014-10-13 14:00:42 -07:00
egdaniel
ccb2e384a0 Create helper functions to use in computeInvariantOutput calls
BUG=skia:

Review URL: https://codereview.chromium.org/643743003
2014-10-13 12:53:46 -07:00
cdalton
47c844aaba Adds a GrTBaseList class that GrInOrderDrawBuffer uses to allocate
all its commands interleaved in contiguous memory. GrTBaseList also
supports extra data associated with objects, so we can store arrays
inline without having to call malloc().

Review URL: https://codereview.chromium.org/628453002
2014-10-13 12:43:10 -07:00
bsalomon
81beccc4fb Devirtualize read/write pixels on surface.
Consolidate read/write funcs in context.

Remove support for reading pixels from a surface that's not a target. It's currently broken and neither used nor tested.

Review URL: https://codereview.chromium.org/648863002
2014-10-13 12:32:55 -07:00
bsalomon
d27726eccb Fix leak in GLPrograms test.
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/648063002
2014-10-12 05:40:01 -07:00
joshualitt
a5305a110a Opt state takes a GP instead of a GeometryStage
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/71856d520461ae025a0332aa0ce9735a096d9baf

Review URL: https://codereview.chromium.org/637003003
2014-10-10 17:47:00 -07:00
joshualitt
89c7a2ec3e Revert of Opt state takes a GP instead of a GeometryStage (patchset #18 id:1500001 of https://codereview.chromium.org/637003003/)
Reason for revert:
Revert because this may be causing a break in a chrome gpu test

Original issue's description:
> Opt state takes a GP instead of a GeometryStage
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/71856d520461ae025a0332aa0ce9735a096d9baf

TBR=bsalomon@google.com,egdaniel@google.com,danakj@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/647183002
2014-10-10 14:11:59 -07:00
robertphillips
7bb9ed756e Fix bug in GrCachedLayer reuse
In the new MultiPictureDraw tests a single hoisted layer is reused multiple times. The previous plot locking scheme allowed GrCachedLayer objects to be aggressively deleted prematurely leaving the reusing GrHoistedLayer objects with dangling pointers.

This CL changes adds a new pseudo-ref to GrCachedLayer. (It can't be a real ref since the cached layers aren't deleted when it goes to 0).

NOTRY=true

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

Review URL: https://codereview.chromium.org/640323002
2014-10-10 11:38:29 -07:00
joshualitt
71856d5204 Opt state takes a GP instead of a GeometryStage
BUG=skia:

Review URL: https://codereview.chromium.org/637003003
2014-10-10 09:56:55 -07:00
robertphillips
232f6b0f90 Remove unused SaveLayerInfo::fValid field
Minor code cleanup

Review URL: https://codereview.chromium.org/643713002
2014-10-09 16:43:42 -07:00
joshualitt
1598899975 FPs now use the correct builder types(just a rename)
BUG=skia:

Review URL: https://codereview.chromium.org/648463003
2014-10-09 15:04:05 -07:00
joshualitt
9e87fa7c0e Force linking of static member variables for GLPrograms
BUG=skia:

Review URL: https://codereview.chromium.org/614163002
2014-10-09 13:12:35 -07:00
joshualitt
651713408c gl programs rewrite
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/07a255310aca9f3e83bf741dc663a58818ad681c

Review URL: https://codereview.chromium.org/628633003
2014-10-09 07:25:36 -07:00
caryclark
99d5915a02 rename command line flag to avoid conflict, use very verbose
TBR=
NOTRY=true
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/645573003
2014-10-09 07:08:59 -07:00
mtklein
208d1704c2 Add SkBBoxHierarchy::reserve() as an optional size hint.
I want to play around with how SkTileGrid stores its tiles.  Having a
cap on the number of insert() calls can be pretty handy.

While I'm at it, I gave flush() a default empty impl.  Like reserve(),
it's really an optional hook for subclasses.

BUG=skia:

Review URL: https://codereview.chromium.org/639933003
2014-10-09 06:49:47 -07:00
caryclark
a9c56525f3 try again to fix ios build
TBR=
NOTRY=true
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/638403002
2014-10-09 06:37:50 -07:00
caryclark
ff9fc4e4c9 fix ios build
NOTREECHECKS=true
NOTRY=true
TBR=

Review URL: https://codereview.chromium.org/641063002
2014-10-09 06:13:50 -07:00
caryclark
feff7d2d77 Draw more accurate thick-stroked Beziers (disabled)
Draw thick-stroked Beziers by computing the outset quadratic, measuring the error, and subdividing until the error is within a predetermined limit.

To try this CL out, change src/core/SkStroke.h:18 to

  #define QUAD_STROKE_APPROXIMATION 1

or from the command line: CPPFLAGS="-D QUAD_STROKE_APPROXIMATION=1" ./gyp_skia

Here's what's in this CL:

bench/BezierBench.cpp : a microbench for examining where the time is going
gm/beziers.cpp        : random Beziers with various thicknesses
gm/smallarc.cpp       : a distillation of bug skia:2769
samplecode/SampleRotateCircles.cpp : controls added for error, limit, width
src/core/SkStroke.cpp : the new stroke implementation (disabled)
tests/StrokerTest.cpp : a stroke torture test that checks normal and extreme values

The new stroke algorithm has a tweakable parameter:

  stroker.setError(1);  (SkStrokeRec.cpp:112)

The stroke error is the allowable gap between the midpoint of the stroke quadratic and the center Bezier. As the projection from the quadratic approaches the endpoints, the error is decreased proportionally so that it is always inside the quadratic curve.

An overview of how this works:
- For a given T range of a Bezier, compute the perpendiculars and find the points outset and inset for some radius.
- Construct tangents for the quadratic stroke.
- If the tangent don't intersect between them (may happen with cubics), subdivide.
- If the quadratic stroke end points are close (again, may happen with cubics), draw a line between them.
- Compute the quadratic formed by the intersecting tangents.
- If the midpoint of the quadratic is close to the midpoint of the Bezier perpendicular, return the quadratic.
- If the end of the stroke at the Bezier midpoint doesn't intersect the quad's bounds, subdivide.
- Find where the Bezier midpoint ray intersects the quadratic.
- If the intersection is too close to the quad's endpoints, subdivide.
- If the error is large proportional to the intersection's distance to the quad's endpoints, subdivide.

BUG=skia:723,skia:2769

Review URL: https://codereview.chromium.org/558163005
2014-10-09 05:36:04 -07:00
kkinnunen
9e61bb7815 Make the Sk GL context class an abstract base class
Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before,
it depended on ifdefs to implement the platform dependent polymorphism.  Move
the logic to subclasses of the various platform implementations.

This a step to enable Skia embedders to compile dm and bench_pictures. The
concrete goal is to support running these test apps with Chromium command buffer.

With this change, Chromium can implement its own version of SkGLNativeContext
that uses command buffer, and host the implementation in its own repository.

Implements the above by renaming the SkGLContextHelper to SkGLContext and
removing the unneeded SkGLNativeContext. Also removes
SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused:
no use in Skia code, and no tests.

BUG=skia:2992

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

Review URL: https://codereview.chromium.org/630843002
2014-10-09 05:24:15 -07:00
bsalomon
bcf0a52d4f GrResourceCache2 manages scratch texture.
BUG=skia:2889

Review URL: https://codereview.chromium.org/608883003
2014-10-08 08:40:09 -07:00
reed
9d93c2ebb3 Add SkCachedData and use it for SkMipMap
This reverts commit 37c5a815d8.

TBR=mtklein

Review URL: https://codereview.chromium.org/635333002
2014-10-08 05:17:12 -07:00
bsalomon
10805961ce Revert of Make the Sk GL context class an abstract base class (patchset #4 id:60001 of https://codereview.chromium.org/630843002/)
Reason for revert:
nanobech failing on Android

Original issue's description:
> Make the Sk GL context class an abstract base class
>
> Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before,
> it depended on ifdefs to implement the platform dependent polymorphism.  Move
> the logic to subclasses of the various platform implementations.
>
> This a step to enable Skia embedders to compile dm and bench_pictures. The
> concrete goal is to support running these test apps with Chromium command buffer.
>
> With this change, Chromium can implement its own version of SkGLNativeContext
> that uses command buffer, and host the implementation in its own repository.
>
> Implements the above by renaming the SkGLContextHelper to SkGLContext and
> removing the unneeded SkGLNativeContext. Also removes
> SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused:
> no use in Skia code, and no tests.
>
> BUG=skia:2992
>
> Committed: https://skia.googlesource.com/skia/+/a90ed4e83897b45d6331ee4c54e1edd4054de9a8

TBR=kkinnunen@nvidia.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2992

Review URL: https://codereview.chromium.org/639793002
2014-10-08 04:45:10 -07:00
kkinnunen
a90ed4e838 Make the Sk GL context class an abstract base class
Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before,
it depended on ifdefs to implement the platform dependent polymorphism.  Move
the logic to subclasses of the various platform implementations.

This a step to enable Skia embedders to compile dm and bench_pictures. The
concrete goal is to support running these test apps with Chromium command buffer.

With this change, Chromium can implement its own version of SkGLNativeContext
that uses command buffer, and host the implementation in its own repository.

Implements the above by renaming the SkGLContextHelper to SkGLContext and
removing the unneeded SkGLNativeContext. Also removes
SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused:
no use in Skia code, and no tests.

BUG=skia:2992

Review URL: https://codereview.chromium.org/630843002
2014-10-08 04:14:24 -07:00
joshualitt
47bb382830 Cleanup of shader building system
this is a huge refactor and cleanup of the gl shader building system in
Skia.  The entire shader building pipeline is now part of
GrGLProgramCreator, which takes a gp, and some fps, and creates a
program.  I added some subclasses of GrGLProgram to handle the
eccentricities of Nvpr/Nvpres.  Outside of the builders folder
and GrGLPrograms, this change is basically just a rename

solo gp

BUG=skia:

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

Review URL: https://codereview.chromium.org/611653002
2014-10-07 16:43:25 -07:00
joshualitt
db0d3ca070 Revert of Cleanup of shader building system (patchset #25 id:470001 of https://codereview.chromium.org/611653002/)
Reason for revert:
Seems to have messed up windows 7 gms

Original issue's description:
> Cleanup of shader building system
>
> this is a huge refactor and cleanup of the gl shader building system in
> Skia.  The entire shader building pipeline is now part of
> GrGLProgramCreator, which takes a gp, and some fps, and creates a
> program.  I added some subclasses of GrGLProgram to handle the
> eccentricities of Nvpr/Nvpres.  Outside of the builders folder
> and GrGLPrograms, this change is basically just a rename
>
>
> solo gp
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/fe1233c3f12f81bb675718516bbb32f72af726ec

TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/635533005
2014-10-07 12:42:26 -07:00
joshualitt
fe1233c3f1 Cleanup of shader building system
this is a huge refactor and cleanup of the gl shader building system in
Skia.  The entire shader building pipeline is now part of
GrGLProgramCreator, which takes a gp, and some fps, and creates a
program.  I added some subclasses of GrGLProgram to handle the
eccentricities of Nvpr/Nvpres.  Outside of the builders folder
and GrGLPrograms, this change is basically just a rename

solo gp

BUG=skia:

Review URL: https://codereview.chromium.org/611653002
2014-10-07 12:16:36 -07:00
Brian Salomon
9323b8b8e1 Revert "GrResourceCache2 manages scratch texture."
This reverts commit d14e1a2764.
2014-10-07 15:07:38 -04:00
mtklein
fb1fe4f518 Add SkPaint::getHash().
BUG=skia:

Review URL: https://codereview.chromium.org/637583002
2014-10-07 09:26:10 -07:00
joshualitt
d909759832 Revert of gl programs rewrite (patchset #10 id:180001 of https://codereview.chromium.org/628633003/)
Reason for revert:
breaks angle bot

Original issue's description:
> gl programs rewrite
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/07a255310aca9f3e83bf741dc663a58818ad681c

TBR=bsalomon@google.com,egdaniel@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/631183003
2014-10-07 08:37:36 -07:00
joshualitt
07a255310a gl programs rewrite
BUG=skia:

Review URL: https://codereview.chromium.org/628633003
2014-10-07 08:05:21 -07:00
bsalomon
d14e1a2764 GrResourceCache2 manages scratch texture.
BUG=skia:2889

Review URL: https://codereview.chromium.org/608883003
2014-10-07 07:27:07 -07:00
egdaniel
b109ac22b4 Make createOptDrawState return NULL if we would end up not drawing
BUG=skia:

Review URL: https://codereview.chromium.org/630063002
2014-10-07 06:45:44 -07:00
egdaniel
307796bc2e Plumb OptDrawState down to VertexShaderBuilder
BUG=skia:

Review URL: https://codereview.chromium.org/628293002
2014-10-06 12:13:54 -07:00
piotaixr
f05f5a7399 Remove globals from tests/CanvasTest.cpp
BUG=skia:

Review URL: https://codereview.chromium.org/617093004
2014-10-03 13:26:55 -07:00
reed
37c5a815d8 Speculative revert to diagnose crash in chrome. Revert "Add SkCachedData and use it for SkMipMap"
This reverts commit 92561a0b99.

crasher in question:
https://code.google.com/p/chromium/issues/detail?id=420178

Review URL: https://codereview.chromium.org/617613003
2014-10-03 13:23:31 -07:00
egdaniel
1a8ecdfb73 Add isSingleComponent bool to getConstantColorComponent
Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/3b8af078281a5a20f951b9fd84f38d92b8f6217b

Review URL: https://codereview.chromium.org/608253002
2014-10-03 06:24:12 -07:00
caryclark
d751ac01a3 abort op early if path isn't parseable
TBR=
BUG=419649

Review URL: https://codereview.chromium.org/623943002
2014-10-03 05:36:27 -07:00
reed
92561a0b99 Add SkCachedData and use it for SkMipMap
Review URL: https://codereview.chromium.org/592843003
2014-10-02 13:47:08 -07:00
robertphillips
b4b7a4c9ea Revert of Add isSingleComponent bool to getConstantColorComponent (patchset #6 id:100001 of https://codereview.chromium.org/608253002/)
Reason for revert:
Changing some GMs

Original issue's description:
> Add isSingleComponent bool to getConstantColorComponent
>
> Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3b8af078281a5a20f951b9fd84f38d92b8f6217b

TBR=joshualitt@chromium.org,bsalomon@google.com,reed@google.com,egdaniel@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/617853003
2014-10-02 12:12:48 -07:00
piotaixr
e4b231428e Caching the result of readPixelsSupported
The call was calling GR_GL_GetIntegerv 2 times for each readPixels
and thus was causing a loss of performance

(resubmit of issue 344793008)

Benchmark url: http://packages.gkny.fr/tst/index.html

BUG=skia:2681

Committed: https://skia.googlesource.com/skia/+/753a2964afe5661ce9b2a8ca77ca9d0aabd3173c

Committed: https://skia.googlesource.com/skia/+/8339371f1ec3c57a0741932fd96bff32c53d4e54

Review URL: https://codereview.chromium.org/364193004
2014-10-02 10:57:53 -07:00
egdaniel
3b8af07828 Add isSingleComponent bool to getConstantColorComponent
Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components.

BUG=skia:

Review URL: https://codereview.chromium.org/608253002
2014-10-02 09:57:48 -07:00
mtklein
8f8c25eabb Demote getCount, getDepth, and clear to RTree-only methods.
We use them only to test RTree.

BUG=skia:

Review URL: https://codereview.chromium.org/622773003
2014-10-02 09:53:04 -07:00
mtklein
ed48ebe39e Archive more dead code.
These classes were used by QuadTree, which has been archived (with prejudice).

BUG=skia:

Review URL: https://codereview.chromium.org/616963006
2014-10-02 09:06:02 -07:00
mtklein
6bd41969a0 BBHs: void* data -> unsigned data
Now that the old backend's not using BBHs, we can specialize them for
SkRecord's needs.  The only thing we really want to store is op index, which
should always be small enough to fit into an unsigned (unsigned also helps keep
it straight from other ints floating around).

This means we'll need half (32-bit) or a quarter (64-bit) the bytes in SkTileGrid,
because we don't have to store an extra int for ordering.

BUG=skia:2834

Review URL: https://codereview.chromium.org/617393004
2014-10-02 07:41:56 -07:00
mtklein
8e393bf70e Don't adjust the bounds after a restore with the restore's paired saveLayer's paint.
It makes no sense for the paint from a saveLayer to effect anything outside its saveLayer/restore block.  But as currently written, we'll adjust the clip bounds just after a restore by that paint.

Turns out the test I wrote for the last CL (which caused this bug) actually had the bug baked into its expectations.  I've updated them and added some notes to explain.

BUG=418417

Review URL: https://codereview.chromium.org/623563002
2014-10-01 12:48:58 -07:00
mtklein
8e12656096 Remove DEPRECATED_beginRecording().
This removes:
  1) ability to record old pictures with SkPictureRecorder;
  2) a couple tests specific to the old backend.

The functionality of DEPRECATED_beginRecording() now lives in
(private) SkPicture::Backport(), which is the only place we
need it now.

BUG=skia:
TBR=reed@google.com

Review URL: https://codereview.chromium.org/618303002
2014-10-01 09:29:35 -07:00
robertphillips
68cd2aa797 Update GrRecordReplaceDraw to use SkTDynamicHash & add ReplaceDraw
Having hoisted layers from different pictures invalidates the assumptions of the old GrReplacements object. This is fixed by switching to a SkTDynamicHash-based back-end.

Sub-picture-layers also require that the replacement drawing occur for the sub-pictures too. The ReplaceDraw object is added to make this happen and limit the replacement lookup to saveLayer draw commands.

This is split out of (Fix sub-picture layer rendering bugs - https://codereview.chromium.org/597293002/).

BUG=skia:2315

Review URL: https://codereview.chromium.org/607763008
2014-10-01 09:24:06 -07:00
mtklein
f6fde175b8 Archive more dead code.
BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/617003004
2014-09-30 15:22:06 -07:00
mtklein
46616af01b Strip old backend recording down to essentials
Feature-wise, this removes:
  1) BBH support;
  2) peephole optimizations;
  3) record-time text op specializations;
  4) the guarantee that SkPaints are flattened.

This deletes the optimizations GM, which only exists to test the peepholes of
the old backend.  SkRecord optimizations are unit tested, and if that ever fails we
can think about adding another GM like this, but they're different enough we'd
want to start from scratch anyway.

We need to keep the code that plays back the specialized text ops around for
a while for compatibility with existing .SKPs that have those ops recorded.

BUG=skia:

CQ_EXTRA_TRYBOTS=tryserver.skia:Canary-Chrome-Ubuntu13.10-Ninja-x86_64-ToT-Trybot
R=robertphillips@google.com, reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/617953002
2014-09-30 14:47:10 -07:00
bsalomon
afbf2d6273 Make "priv" classes for GrTexure and GrSurface.
R=robertphillips@google.com, egdaniel@google.com, joshualitt@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/596053002
2014-09-30 12:18:44 -07:00
robertphillips
b06e5a2f55 Revert of Make "priv" classes for GrTexure and GrSurface. (patchset #9 id:260001 of https://codereview.chromium.org/596053002/)
Reason for revert:
Breaking the Chrome builds with:

 lib/libcc.so: error: undefined reference to 'GrAutoScratchTexture::detach()'

(http://108.170.220.120:10117/builders/Canary-Chrome-Ubuntu13.10-Ninja-x86_64-DRT/builds/2990/steps/Retry_BuildContentShell_1/logs/stdio)

Original issue's description:
> Make "priv" classes for GrTexure and GrSurface.

R=egdaniel@google.com, joshualitt@google.com, bsalomon@google.com
TBR=bsalomon@google.com, egdaniel@google.com, joshualitt@google.com
NOTREECHECKS=true
NOTRY=true

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/618733002
2014-09-30 06:58:20 -07:00
robertphillips
dbe6074a06 Revert of GrResourceCache2 manages scratch texture. (patchset #14 id:260001 of https://codereview.chromium.org/608883003/)
Reason for revert:
Turning bots red:
Nanobench seems to be uniformly failing on Android
(http://108.170.220.21:10117/builders/Perf-Android-Venue8-PowerVR-x86-Release/builds/99/steps/RunNanobench/logs/stdio)

Ubuntu GTX660 32bit is failing in both Debug and Release on GM generation (it appears to be out of memory) (http://108.170.220.120:10117/builders/Test-Ubuntu12-ShuttleA-GTX660-x86-Debug/builds/2457/steps/GenerateGMs/logs/stdio)

Original issue's description:
> GrResourceCache2 manages scratch texture.
>
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3d398c876440deaab39bbf2a9b881c337e6dc8d4

R=bsalomon@google.com
TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/611383003
2014-09-30 06:54:17 -07:00
bsalomon
3d398c8764 GrResourceCache2 manages scratch texture.
BUG=skia:
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/608883003
2014-09-30 06:02:23 -07:00
bsalomon
c0eb9b9818 Make "priv" classes for GrTexure and GrSurface.
R=robertphillips@google.com, egdaniel@google.com, joshualitt@google.com, joshualitt@chromium.org

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/596053002
2014-09-29 14:20:11 -07:00
reed
c5e15a1afa remove alphatype from colortable
the owning bitmap is (already) responsible for knowing the alphatype

BUG=skia:
R=djsollen@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/611093002
2014-09-29 12:10:27 -07:00
robertphillips
ed42059d2f Move offset and CTM from LayerCache Key to per-hoisted-layer info
This CL reduces the amount of information used in the layer cache key:
- the stop value isn't needed since the start value uniquely identifies the layer in the picture.
- only the upper-left 2x2 portion of the CTM should be used as a key for looking up cached layers.
- individual layers can be redraw in different locations so the final offset cannot be a part of the key.

Since this data is no longer stored in the cached layer, but is still required to draw the cached layer, it is now stored in the per-layer information (i.e., HoistedLayer).

This is split out of (Fix sub-picture layer rendering bugs - https://codereview.chromium.org/597293002/).

BUG=skia:2315
R=egdaniel@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/609403003
2014-09-29 11:39:38 -07:00
senorblanco
3a49520696 Sanitize SkMatrixConvolutionImageFilter creation params.
Apply the same memory limit in the Create() function that we do when
deserializing.

R=reed@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/610723002
2014-09-29 07:57:20 -07:00
caryclark
c06d9a7a7e fail on extremely large coincident curves
TBR=
BUG=418381

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/607913007
2014-09-29 06:58:41 -07:00
robertphillips
ee6631ef90 Update RecordReplaceDrawTest to generate and pass pictures
This CL splits the unit test changes out of (Fix sub-picture layer rendering bugs - https://codereview.chromium.org/597293002/).

For various reasons GrRecordReplaceDraw now needs to take an SkPicture (rather than an SkRecord and a BBH).

R=egdaniel@google.com, bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/608823002
2014-09-29 05:32:50 -07:00
tomhudson
faccb8eb53 SkMatrix44::preserves2dAxisAlignment()
Convenience function requested for Chrome compositor that may have a performance
advantage.

BUG=skia:1017
R=reed@google.com, danakj@chromium.org, vollick@chromium.org

Author: tomhudson@google.com

Review URL: https://codereview.chromium.org/508303005
2014-09-26 11:45:48 -07:00
senorblanco
91c395af69 Fix SkTableColorFilter deserialization validation.
Broken in https://skia.googlesource.com/skia/+/9fa60daad4d5f54c0dbe3dbcc7608a8f6d721187.

R=reed@google.com
TBR=reed@google.com

BUG=skia:

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/604873004
2014-09-25 15:51:35 -07:00
mtklein
610a015fda Remove SkPaint dirty bits.
fDirtyBits is only used by SkPaint::FlatteningTraits, which in turn was
only used as a smaller, faster format to flatten paints in-memory to dedup
them in the old picture backend.

SkRecord obsoleted all this.  Neither flatten()/unflatten() (disk format)
nor FlatteningTraits is used anywhere performance or size matters.

Here I revert the deduping code back to using the disk format for flattened paints.
We stil do have to flatten and unflatten paints while coverting from SkRecord
backend to the old backend, so we can't just delete this all yet, but any
faithful round trip flatten()/unflatten() pair will be fine, however slow.

NOTRY=true

BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/604813003
2014-09-25 11:57:53 -07:00
piotaixr
b5fae93d72 SkCanvas::drawImage is the new way for drawing a SkImage to a Canvas
BUG=skia:2947

Committed: https://skia.googlesource.com/skia/+/432789972c1e1f8a66165c75a250dba1853efa08

R=junov@chromium.org, reed@google.com, bsalomon@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/583453002
2014-09-24 13:03:30 -07:00
senorblanco
0f7197bc0d Fix SkXfermode deserialization.
Validation was failing due to an inverted test condition.

BUG=417266
R=reed@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/596333002
2014-09-24 11:09:38 -07:00
bungeman
7b09aab713 Correct glyph with non-bmp from typeface on Mac.
CTFontGetGlyphsForChars puts the glyph id at the index of the lead
surrogate as is documented in comments, but the code is looking at
the index of the trail surrogate.

BUG=skia:2960
R=mtklein@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/596413002
2014-09-24 11:04:41 -07:00
borenet
2456b7681a Revert of SkCanvas::drawImage is the new way for drawing an SkImage to a Canvas (patchset #9 id:160001 of https://codereview.chromium.org/583453002/)
Reason for revert:
Broke ChromiumOS Ozone builder: http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Ozone%20Builder/builds/4087/steps/compile/logs/stdio

Reverting to unblock DEPS roll.

Original issue's description:
> SkCanvas::drawImage is the new way for drawing a SkImage to a Canvas
>
> BUG=skia:2947
>
> Committed: https://skia.googlesource.com/skia/+/432789972c1e1f8a66165c75a250dba1853efa08

R=junov@chromium.org, reed@google.com, bsalomon@google.com, piotaixr@chromium.org
TBR=bsalomon@google.com, junov@chromium.org, piotaixr@chromium.org, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2947

Author: borenet@google.com

Review URL: https://codereview.chromium.org/598133002
2014-09-24 11:03:35 -07:00
robertphillips
30d2cc6ff4 Update layer hoisting code to correctly render sub-picture layers
The prior code assumed all layers came from a single picture.

BUG=skia:2315
R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/595543002
2014-09-24 08:52:19 -07:00
piotaixr
432789972c SkCanvas::drawImage is the new way for drawing a SkImage to a Canvas
BUG=skia:2947
R=junov@chromium.org, reed@google.com, bsalomon@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/583453002
2014-09-23 14:10:50 -07:00
Mike Klein
271a030f5d We need to adjust the bounds of clip ops with SaveLayer paints too.
Before this CL, SkRecord only adjusted the bounds of draw ops for SaveLayers' paints.
That worked fine, but as a final step we intersect the bounds of draw ops with the
bounds of the current clip, essentially undoing all that work.

I think the right fix here is to also adjust the bounds of the clip ops.

BUG=skia:2957, 415468
R=robertphillips@google.com

Review URL: https://codereview.chromium.org/595953002
2014-09-23 15:28:38 -04:00
joshualitt
b0a8a377f8 Patch to create a distinct geometry processor. The vast majority of this patch
is just a rename.  The meat is in GrGeometryProcessor, GrProcessor,
GrGL*Processor, GrProcessorStage, Gr*BackendProcessorFactory,
GrProcessUnitTestFactory, and the builders

BUG=skia:
R=bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/582963002
2014-09-23 09:50:21 -07:00
egdaniel
c06482494d Calculate Primary and Secondary output types in the GrOptDrawState
Follow up CL to https://codereview.chromium.org/545693004/

BUG=skia:
R=bsalomon@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/554833002
2014-09-22 13:17:03 -07:00
egdaniel
ae444965c4 Change GrGLProgramDesc header to have DoPathRendering flag instead of RequiresVertexShader
Also update GLProgramTests to fix bug where it would incorrectly try to PathRendering when we did
not want to.

BUG=skia:
R=bsalomon@google.com, joshualitt@chromium.org

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/586793002
2014-09-22 12:29:52 -07:00
mtklein
ee902cd4f4 Make a flipped fDirtyBit always mean "this field is not the default".
Haven't been able to measure any perf effect, so I figure I'll let the bots have at it.

BUG=skia:
R=mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/595583003
2014-09-22 11:40:33 -07:00
reed
4a8126e7f8 Introduce Props to surface (patchset #27 id:520001 of https://codereview.chromium.org/551463004/)"
This reverts commit 29c857d0f3.

TBR=

Author: reed@google.com

Review URL: https://codereview.chromium.org/588143004
2014-09-22 07:29:03 -07:00
reed
29c857d0f3 Revert of introduce Props to surface (patchset #27 id:520001 of https://codereview.chromium.org/551463004/)
Reason for revert:
Broke call site in WebKit

Original issue's description:
> introduce Props to surface (work in progress)
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3716fd067a5621bb94a6cb08d72afec8bf3aceda

R=robertphillips@google.com, bsalomon@google.com, jvanverth@google.com, bungeman@google.com, fmalita@google.com, vangelis@chromium.org, reed@google.com
TBR=bsalomon@google.com, bungeman@google.com, fmalita@google.com, jvanverth@google.com, reed@google.com, robertphillips@google.com, vangelis@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/583773004
2014-09-21 10:25:07 -07:00
reed
3716fd067a introduce Props to surface (work in progress)
BUG=skia:
R=robertphillips@google.com, bsalomon@google.com, jvanverth@google.com, bungeman@google.com, fmalita@google.com, vangelis@chromium.org, reed@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/551463004
2014-09-21 09:39:55 -07:00
fmalita
3c196def91 Souped-up SkTextBlob.
Refactored text blob backend for improved performance: instead of using
separate buffers for runs/positions/glyphs, everything is now packed in
a consolidated slab (including the SkTextBlob object itself!).

Benefits:

 * number of allocations per blob construction reduced from ~4 to 1
   (also minimizes internal fragmentation)
 * run record size reduced by 8 bytes

This takes the blob construction overhead down to negligible levels
(for the current Blink uncached textblob implementation).

Unfortunately, the code is much more finicky (run merging in
particular) -- hence the assert spree.

Multi-run blobs are vulnerable to realloc storms but this is not a
problem at the moment because Blink is using one-run blobs 99% of the
time. Will be addressed in the future.

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

Committed: https://skia.googlesource.com/skia/+/13645ea0ea87038ebd71be3bd6d53b313069a9e4

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/581173003
2014-09-20 05:40:22 -07:00
fmalita
e50215e598 Revert of Souped-up SkTextBlob. (patchset #3 id:40001 of https://codereview.chromium.org/581173003/)
Reason for revert:
Broke the new blobshader gm.

Original issue's description:
> Souped-up SkTextBlob.
>
> Refactored text blob backend for improved performance: instead of using
> separate buffers for runs/positions/glyphs, everything is now packed in
> a consolidated slab (including the SkTextBlob object itself!).
>
> Benefits:
>
>  * number of allocations per blob construction reduced from ~4 to 1
>    (also minimizes internal fragmentation)
>  * run record size reduced by 8 bytes
>
> This takes the blob construction overhead down to negligible levels
> (for the current Blink uncached textblob implementation).
>
> Unfortunately, the code is much more finicky (run merging in
> particular) -- hence the assert spree.
>
> Multi-run blobs are vulnerable to realloc storms but this is not a
> problem at the moment because Blink is using one-run blobs 99% of the
> time. Will be addressed in the future.
>
>
> R=reed@google.com,mtklein@google.com,robertphillips@google.com
>
> Committed: https://skia.googlesource.com/skia/+/13645ea0ea87038ebd71be3bd6d53b313069a9e4

R=mtklein@google.com, reed@google.com, robertphillips@google.com
TBR=mtklein@google.com, reed@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/588853002
2014-09-19 19:03:06 -07:00
fmalita
13645ea0ea Souped-up SkTextBlob.
Refactored text blob backend for improved performance: instead of using
separate buffers for runs/positions/glyphs, everything is now packed in
a consolidated slab (including the SkTextBlob object itself!).

Benefits:

 * number of allocations per blob construction reduced from ~4 to 1
   (also minimizes internal fragmentation)
 * run record size reduced by 8 bytes

This takes the blob construction overhead down to negligible levels
(for the current Blink uncached textblob implementation).

Unfortunately, the code is much more finicky (run merging in
particular) -- hence the assert spree.

Multi-run blobs are vulnerable to realloc storms but this is not a
problem at the moment because Blink is using one-run blobs 99% of the
time. Will be addressed in the future.

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

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/581173003
2014-09-19 18:37:00 -07:00
bsalomon
43d361f7fa Stop calling rand() in debug-only code for GLProgramsTest
R=egdaniel@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/584913002
2014-09-19 07:47:08 -07:00
caryclark
630240d188 fail early if coincidence can't be resolved
Bail out if a very large value causes coincidence resolution to
fail.

TBR=
BUG=415866

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/585913002
2014-09-19 06:33:31 -07:00
piotaixr
0d276f71d2 Bis: Use SkImage::NewFromGenerator() instead of SkImage::newEncodedData()
BUG=skia:2948
R=junov@chromium.org, reed@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/579923002
2014-09-18 11:55:14 -07:00
bungeman
d71b757573 Serialize the font index.
BUG=skia:1186
R=reed@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/567013002
2014-09-18 10:55:32 -07:00
caryclark
65b427cff9 fix battlefield website by disallowing very small coordinates
also add and remove comments to document other attempts to fix this that had drawbacks

R=fmalita@chromium.org
BUG=414409

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/575553003
2014-09-18 10:32:57 -07:00
robertphillips
a0537deca2 Copy layer-hoisting related SkPaints
This is intended to disconnect the lifetimes of the optimization data, cached layers and replacement objects.

Note that the optimization data already makes a copy of the paint in the SkPicture. Additionally the replacement object will probably go away at some point.

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/579843002
2014-09-18 08:01:23 -07:00
reed
69f6f00fd9 use surface instead of explicitly making gpudevice
TBR=bsalomon

Author: reed@google.com

Review URL: https://codereview.chromium.org/585493002
2014-09-18 06:09:44 -07:00
mtklein
6a5c7085bc Add SkMiniData.
This is a bit like a limited SkData, geared to store really tiny byte strings.

This is not hooked up anywhere beyond the new unit test.  I did experimentally
plumb it into SkRecord for drawPosTextH: just over 40% of drawPosTextH calls in
our repo can fit into ShortData.

BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/573323002
2014-09-17 12:21:59 -07:00
egdaniel
a7dc0a83f0 Calculate stage stats in GrOptDrawState
BUG=skia:
R=bsalomon@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/545693004
2014-09-17 08:25:05 -07:00
robertphillips
4aa6dfc0b7 Separate replacement creation from layer discovery
This is a simple refactoring that sets the stage for eliminating GrReplacements::ReplacementInfo and splitting up EXPERIMENTAL_drawPicture to support multi picture draw.

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/559603004
2014-09-17 07:50:47 -07:00
mtklein
1e78fc4ed2 Turn disable or delete optimizations that don't have any effect.
Recording gets a ~5% speedup.

BUG=skia:
R=robertphillips@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/577673003
2014-09-16 11:11:20 -07:00
reed
30ad5306be allow SkBitmapCache to operate on a local instance, for testability
BUG=skia:
R=mtklein@google.com, danakj@chromium.org, piotaixr@chromium.org, junov@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/576763002
2014-09-16 10:39:55 -07:00
robertphillips
4815fe5a0a Fix bug in layer hoisting transition to SkRecord backend
Care must be taken when setting up the initial CTM matrix for partial SkRecord playbacks b.c. all the setMatrix calls will concatenate with the initial matrix (which may be different then the CTM that is required to draw correctly).

R=mtklein@google.com, bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/549143003
2014-09-16 10:32:43 -07:00
robertphillips
c506e3007e Fix convexicator bug
BUG=crbug.com/412640
R=caryclark@google.com, bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/573763002
2014-09-16 09:43:32 -07:00
tomhudson
a32f1758b7 Add helper SkMatrix44::hasPerspective()
BUG=skia:1017
R=danakj@chromium.org, reed@google.com

Author: tomhudson@google.com

Review URL: https://codereview.chromium.org/513343002
2014-09-16 08:29:29 -07:00
joshualitt
49586bec73 removing GrDrawEffect
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/8ddbe8b9366c8c59c4fb55f01f253de8a0b37d6e

R=bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/571163002
2014-09-16 08:21:42 -07:00