Commit Graph

1971 Commits

Author SHA1 Message Date
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