Commit Graph

2049 Commits

Author SHA1 Message Date
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
joshualitt
08da4f22d7 Revert of removing GrDrawEffect (patchset #4 id:60001 of https://codereview.chromium.org/571163002/)
Reason for revert:
reverting to unblock another revert

Original issue's description:
> removing GrDrawEffect
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/8ddbe8b9366c8c59c4fb55f01f253de8a0b37d6e

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

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/577593003
2014-09-16 07:17:28 -07:00
joshualitt
8ddbe8b936 removing GrDrawEffect
BUG=skia:
R=bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/571163002
2014-09-16 06:46:30 -07:00
yunchao.he
49005bf892 Picture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame
blink skips all pending commands during picture recording if it is drawing an opaque full-frame
geometry or image. This may improve performance for some edge cases. To recognize an opaque
full-frame drawing should be cheap enough. Otherwise, the overhead will offset the improvement.
Unfortunately, data from perf for content_shell on Nexus7 shows that SkDeferredCanvas::isFullFrame
is far from cheap. Table below shows that how much isFullFrame() costs in the whole render process.

benchmark                              percentage
my local benchmark(draw 1000 sprites)   4.1%
speedReading                            2.8%
FishIETank(1000 fishes)                 1.5%
GUIMark3 Bitmap                         2.0%

By contrast, real recording (SkGPipeCanvas::drawBitmapRectToRect) and real rasterization
(GrDrawTarget::drawRect) cost ~4% and ~6% in the whole render process respectively. Apparently,
SkDeferredCanvas::isFullFrame() is nontrivial.

getDeviceSize() is the main contributor to this hotspot. The change simply save the canvasSize and
reuse it among drawings if it is not a fresh frame. This change cut off ~65% (or improved ~2 times)
of isFullFrame().

telemetry smoothness canvas_tough_test didn't show obvious improvement or regression.

BUG=411166

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

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

Author: yunchao.he@intel.com

Review URL: https://codereview.chromium.org/545813002
2014-09-15 22:30:38 -07:00
joshualitt
249af15fb8 BUG=skia:
R=bsalomon@google.com, egdaniel@google.com, jvanverth@google.com, robertphillips@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/543623004
2014-09-15 11:41:14 -07:00
reed
c90e0149ec Change SkResourceCache to take a Visitor inside its find().
This reverts commit 595aa05efc.

BUG=skia:
R=mtklein@google.com, danakj@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/569353002
2014-09-15 11:39:45 -07:00
dneto
327f905d2c Fix recording of saveLayout with unusual Xfermodes.
This is the root cause of a Chrome rendering bug when it tiles
layers with masks.

BUG=skia:1291,chromium:401593
R=reed@google.com, mtklein@google.com, junov@chromium.org

Author: dneto@chromium.org

Review URL: https://codereview.chromium.org/568073004
2014-09-15 10:53:16 -07:00
reed
595aa05efc Revert of Change SkResourceCache to take a Visitor inside its find(). (patchset #2 id:20001 of https://codereview.chromium.org/567393002/)
Reason for revert:
crashes on android bots, haven't diagnosed yet

Original issue's description:
> Change SkResourceCache to take a Visitor inside its find().
>
> This simplifies the API/contract, in that there are not any exposed
> lock/unlock scopes.
>
>
> patch from issue 572573002
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/dee6a8e67db39fcbde2b3bb09be1d088ebb9db8a

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/569303002
2014-09-15 10:15:18 -07:00
caryclark
e956259c5a add dumpHex() option to SkPath
This provides exact precision
to help debugging when the float
representation of a SkScalar may
introduce error.

R=reed@google.com

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/571973003
2014-09-15 09:26:09 -07:00
reed
dee6a8e67d Change SkResourceCache to take a Visitor inside its find().
This simplifies the API/contract, in that there are not any exposed
lock/unlock scopes.

patch from issue 572573002

BUG=skia:
R=mtklein@google.com, danakj@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/567393002
2014-09-15 06:44:47 -07:00
mtklein
5087b2c067 Revert of Picture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame (patchset #7 id:140001 of https://codereview.chromium.org/545813002/)
Reason for revert:
This is leaking memory:

http://108.170.220.120:10117/builders/Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-ASAN/builds/2516/steps/RunDM/logs/stdio

Original issue's description:
> Picture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame
>
> blink skips all pending commands during picture recording if it is drawing an opaque full-frame
> geometry or image. This may improve performance for some edge cases. To recognize an opaque
> full-frame drawing should be cheap enough. Otherwise, the overhead will offset the improvement.
> Unfortunately, data from perf for content_shell on Nexus7 shows that SkDeferredCanvas::isFullFrame
> is far from cheap. Table below shows that how much isFullFrame() costs in the whole render process.
>
> benchmark                              percentage
> my local benchmark(draw 1000 sprites)   4.1%
> speedReading                            2.8%
> FishIETank(1000 fishes)                 1.5%
> GUIMark3 Bitmap                         2.0%
>
> By contrast, real recording (SkGPipeCanvas::drawBitmapRectToRect) and real rasterization
> (GrDrawTarget::drawRect) cost ~4% and ~6% in the whole render process respectively. Apparently,
> SkDeferredCanvas::isFullFrame() is nontrivial.
>
> getDeviceSize() is the main contributor to this hotspot. The change simply save the canvasSize and
> reuse it among drawings if it is not a fresh frame. This change cut off ~65% (or improved ~2 times)
> of isFullFrame().
>
> telemetry smoothness canvas_tough_test didn't show obvious improvement or regression.
>
> BUG=411166
>
> Committed: https://skia.googlesource.com/skia/+/8e45c3777d886ba3fe239bb549d06b0693692152

R=junov@chromium.org, tomhudson@google.com, reed@google.com, yunchao.he@intel.com
TBR=junov@chromium.org, reed@google.com, tomhudson@google.com, yunchao.he@intel.com
NOTREECHECKS=true
NOTRY=true
BUG=411166

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/571053002
2014-09-15 06:00:49 -07:00
yunchao.he
8e45c3777d Picture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame
blink skips all pending commands during picture recording if it is drawing an opaque full-frame
geometry or image. This may improve performance for some edge cases. To recognize an opaque
full-frame drawing should be cheap enough. Otherwise, the overhead will offset the improvement.
Unfortunately, data from perf for content_shell on Nexus7 shows that SkDeferredCanvas::isFullFrame
is far from cheap. Table below shows that how much isFullFrame() costs in the whole render process.

benchmark                              percentage
my local benchmark(draw 1000 sprites)   4.1%
speedReading                            2.8%
FishIETank(1000 fishes)                 1.5%
GUIMark3 Bitmap                         2.0%

By contrast, real recording (SkGPipeCanvas::drawBitmapRectToRect) and real rasterization
(GrDrawTarget::drawRect) cost ~4% and ~6% in the whole render process respectively. Apparently,
SkDeferredCanvas::isFullFrame() is nontrivial.

getDeviceSize() is the main contributor to this hotspot. The change simply save the canvasSize and
reuse it among drawings if it is not a fresh frame. This change cut off ~65% (or improved ~2 times)
of isFullFrame().

telemetry smoothness canvas_tough_test didn't show obvious improvement or regression.

BUG=411166
R=junov@chromium.org, tomhudson@google.com, reed@google.com

Author: yunchao.he@intel.com

Review URL: https://codereview.chromium.org/545813002
2014-09-14 18:59:04 -07:00
rileya
abaef86f2b Add support for the Rec601 YUV color space to GrYUVtoRGBEffect.
R=bsalomon@google.com, senorblanco@chromium.org, sugoi@chromium.org, reed@google.com

Author: rileya@chromium.org

Review URL: https://codereview.chromium.org/516463005
2014-09-12 17:45:58 -07:00
mtklein
94c415170b Revert of Add a test that uses C++11 features as a compiler canary. (patchset #2 id:20001 of https://codereview.chromium.org/568913002/)
Reason for revert:
nope, nacl and ubuntu local bots (at least) broken

Original issue's description:
> Add a test that uses C++11 features as a compiler canary.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/86e01df8d1d8848044c3fcc31c1a2008b70fe08c

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

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/565213008
2014-09-12 17:07:34 -07:00
mtklein
86e01df8d1 Add a test that uses C++11 features as a compiler canary.
BUG=skia:
R=bungeman@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/568913002
2014-09-12 17:02:52 -07:00
reed
9594da111d use SkData::NewUninitialized
BUG=skia:
R=bungeman@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/565803005
2014-09-12 12:12:27 -07:00
mtklein
fbe4136845 Clear away any lingering error before testing SkError.
Looks like something's setting an error before ErrorTest runs on our new
Venue8 bots.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/551973004
2014-09-11 14:41:56 -07:00
danakj
790ffe3feb Make SkBitmapCache remove invalid bitmaps from the SkResourceCache.
This adds SkResourceCache::Remove() which will remove a resource from
its cache. The resource is required to be unlocked at the time Remove()
is called.

Then SkBitmapCache::Find() makes use of this to Remove() bitmaps from
the cache whose pixels have been evicted. This allows the bitmap to be
re-added to the cache with pixels again.

After this change, background a tab (and discarding all the bitmaps'
contents) no longer disables image caching for those discarded images
once the tab is visible again.

BUG=skia:2926
NOTRY=true
R=reed@android.com, tomhudson@google.com, reed@google.com

Author: danakj@chromium.org

Review URL: https://codereview.chromium.org/561953002
2014-09-11 10:49:52 -07:00
mtklein
99d6a9ee8b Fix a bug in Save-Restore no-op optimization.
We optimize
    Save
        SaveLayer
        Restore
    Restore
into
    NoOp
        NoOp
        NoOp
    Restore

I'm considering skipping the call to SkRecordOptimize again just to eliminate
this extra variable from landing SkRecord.  Thoughts?

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/560163002
2014-09-10 16:08:28 -07:00
reed
d954498c01 Revert of Revert of allow canvas to force conservative clips (for speed) (patchset #1 id:1 of https://codereview.chromium.org/554033003/)
Reason for revert:
May just rebaseline, plus want to see the results of the chrome tests, so re-trying this CL.

Original issue's description:
> Revert of allow canvas to force conservative clips (for speed) (patchset #7 id:120001 of https://codereview.chromium.org/541593005/)
>
> Reason for revert:
> multipicturedraw failed on nvprmsaa -- don't know why yet
>
> Original issue's description:
> > Allow SkCanvas to be initialized to force conservative rasterclips. This has the following effects:
> >
> > 1. Queries to the current clip will be conservatively large. This can mean the quickReject may return false more often.
> >
> > 2. The conservative clips mean less work is done.
> >
> > 3. Enabled by default for Gpu, Record, and NoSaveLayer canvases.
> >
> > 4. API is private for now.
> >
> > Committed: https://skia.googlesource.com/skia/+/27a5e656c3d6ef22f9cb34de18e1b960da3aa241
>
> TBR=robertphillips@google.com,bsalomon@google.com,mtklein@google.com,junov@google.com
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/6f09709519b79a1159f3826645f1c5fbc101ee11

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

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/560713002
2014-09-09 18:46:22 -07:00
reed
6f09709519 Revert of allow canvas to force conservative clips (for speed) (patchset #7 id:120001 of https://codereview.chromium.org/541593005/)
Reason for revert:
multipicturedraw failed on nvprmsaa -- don't know why yet

Original issue's description:
> Allow SkCanvas to be initialized to force conservative rasterclips. This has the following effects:
>
> 1. Queries to the current clip will be conservatively large. This can mean the quickReject may return false more often.
>
> 2. The conservative clips mean less work is done.
>
> 3. Enabled by default for Gpu, Record, and NoSaveLayer canvases.
>
> 4. API is private for now.
>
> Committed: https://skia.googlesource.com/skia/+/27a5e656c3d6ef22f9cb34de18e1b960da3aa241

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/554033003
2014-09-09 12:51:10 -07:00
reed
27a5e656c3 Allow SkCanvas to be initialized to force conservative rasterclips. This has the following effects:
1. Queries to the current clip will be conservatively large. This can mean the quickReject may return false more often.

2. The conservative clips mean less work is done.

3. Enabled by default for Gpu, Record, and NoSaveLayer canvases.

4. API is private for now.

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/541593005
2014-09-09 12:19:30 -07:00
senorblanco
32673b99a4 Allow negative values in SkBlurImageFilter sigma.
There are two ways negative sigma values may occur: in
the original filter parameters, or after multiplication
by a negative scaling CTM. The former case is
invalid according to the spec, so we continue to check
for it at validation time. In the latter case, we should
interpret it as a horizontal flip in the kernel pixel
access, and simply take the absolute value (since the
filter kernel is symmetric).

Also refactor all this logic into a single place for the
CPU, GPU and onFilterBounds() paths.

BUG=https://code.google.com/p/chromium/issues/detail?id=409602
R=sugoi@google.com, reed@google.com, sugoi@chromium.org

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/555603002
2014-09-09 09:15:04 -07:00
mtklein
c54056c839 Back to hashing source content, not .png.
BUG=skia:
R=jcgregorio@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/560453002
2014-09-09 08:42:04 -07:00
mtklein
e2d4eb7072 Hash .pngs instead of SkBitmaps.
This has the nice property of being able to double-check hashes after the fact.

mtklein@mtklein ~/skia (hash-png)> md5sum bad/8888/3x3bitmaprect.png
deede70ab2f34067d461fb4a93332d4c  bad/8888/3x3bitmaprect.png

mtklein@mtklein ~/skia (hash-png)> grep 3x3bitmaprect_8888 bad/dm.json
   "3x3bitmaprect_8888" : "deede70ab2f34067d461fb4a93332d4c",

I have checked that no two premultiplied colors map to the same unpremultiplied
color (math nerds: unpremultiplication is injective), so a change in
premultiplied SkBitmap will always imply a change in the encoded
unpremultiplied .png.  This means, it's safe to hash .pngs; we won't miss
subtle changes.

BUG=skia:
R=jcgregorio@google.com, stephana@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/549203003
2014-09-08 12:42:23 -07:00
robertphillips
46625e06e2 Fix two SkRecord-backed layer hoisting bugs
The two bugs are/were:
The old loop to draw the hoisted layers included the saveLayer call which caused double application of the layer's paint (This is the +1 change).

The hoisted layer is intended to be drawn in device coordinates. The old code was drawing it in the coordinate space of the saveLayer thus it was misplaced (This is the setMatrix change).

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

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/551843002
2014-09-08 11:37:59 -07:00
caryclark
361b8b0885 fail when coincidence is too far apart
TBR=
BUG=410552

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/556433002
2014-09-08 10:25:38 -07:00
mtklein
93f52a6944 Turn on the save-layer optimization.
BUG=skia:
R=robertphillips@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/551853002
2014-09-08 08:41:37 -07:00
mtklein
87c4138fae Turn on all pixel-perfect SkRecord optimizations.
BUG=skia:
R=robertphillips@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/550083006
2014-09-08 07:31:18 -07:00
bsalomon
49f085dddf "NULL !=" = NULL
R=reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/544233002
2014-09-05 13:34:00 -07:00
bsalomon
a1ae66d252 Add pop_back() to GrAllocator and add unit test.
BUG=skia:2889
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/538183002
2014-09-05 06:13:43 -07:00
mtklein
29dfaa80f5 Implement all SkCanvas overrides that SkPictureRecord does.
Primarily this is for isDrawingToLayer().  drawData() and onNewSurface() are
for completeness.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/545613002
2014-09-04 14:12:44 -07:00
mtklein
26abcf10a4 disable flaky test
BUG=skia:2912
R=reed@google.com, mtklein@google.com, tfarina@chromium.org

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/537363003
2014-09-04 10:50:55 -07:00
joshualitt
bd769d0f1c Initial change to create GeometryProcessor
BUG=skia:
R=bsalomon@google.com, robertphillips@google.com, egdaniel@google.com, jvanverth@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/509153002
2014-09-04 08:56:46 -07:00
robertphillips
c5ba71d2e5 Change SkPicture::draw to playback
R=reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/540963002
2014-09-04 08:42:50 -07:00
mtklein
406654be7a SkThreadPool ~~> SkTaskGroup
SkTaskGroup is like SkThreadPool except the threads stay in
one global pool.  Each SkTaskGroup itself is tiny (4 bytes)
and its wait() method applies only to tasks add()ed to that
instance, not the whole thread pool.

This means we don't need to bring up new thread pools when
tests themselves want to use multithreading (e.g. pathops,
quilt).  We just create a new SkTaskGroup and wait for that
to complete.  This should be more efficient, and allow us
to expand where we use threads to really latency sensitive
places.  E.g. we can probably now use these in nanobench
for CPU .skp rendering.

Now that all threads are sharing the same pool, I think we
can remove most of the custom mechanism pathops tests use
to control threading.  They'll just ride on the global pool
with all other tests now.

This (temporarily?) removes the GPU multithreading feature
from DM, which we don't use.

On my desktop, DM runs a little faster (57s -> 55s) in
Debug, and a lot faster in Release (36s -> 24s).  The bots
show speedups of similar proportions, cutting more than a
minute off the N4/Release and Win7/Debug runtimes.

BUG=skia:

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

R=caryclark@google.com, bsalomon@google.com, bungeman@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/531653002
2014-09-03 15:34:37 -07:00
mtklein
2460bbdfbb Revert of SkThreadPool ~~> SkTaskGroup (patchset #4 id:60001 of https://codereview.chromium.org/531653002/)
Reason for revert:
Leaks, leaks, leaks.

Original issue's description:
> SkThreadPool ~~> SkTaskGroup
>
> SkTaskGroup is like SkThreadPool except the threads stay in
> one global pool.  Each SkTaskGroup itself is tiny (4 bytes)
> and its wait() method applies only to tasks add()ed to that
> instance, not the whole thread pool.
>
> This means we don't need to bring up new thread pools when
> tests themselves want to use multithreading (e.g. pathops,
> quilt).  We just create a new SkTaskGroup and wait for that
> to complete.  This should be more efficient, and allow us
> to expand where we use threads to really latency sensitive
> places.  E.g. we can probably now use these in nanobench
> for CPU .skp rendering.
>
> Now that all threads are sharing the same pool, I think we
> can remove most of the custom mechanism pathops tests use
> to control threading.  They'll just ride on the global pool
> with all other tests now.
>
> This (temporarily?) removes the GPU multithreading feature
> from DM, which we don't use.
>
> On my desktop, DM runs a little faster (57s -> 55s) in
> Debug, and a lot faster in Release (36s -> 24s).  The bots
> show speedups of similar proportions, cutting more than a
> minute off the N4/Release and Win7/Debug runtimes.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/9c7207b5dc71dc5a96a2eb107d401133333d5b6f

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

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/533393002
2014-09-03 14:17:48 -07:00
mtklein
9c7207b5dc SkThreadPool ~~> SkTaskGroup
SkTaskGroup is like SkThreadPool except the threads stay in
one global pool.  Each SkTaskGroup itself is tiny (4 bytes)
and its wait() method applies only to tasks add()ed to that
instance, not the whole thread pool.

This means we don't need to bring up new thread pools when
tests themselves want to use multithreading (e.g. pathops,
quilt).  We just create a new SkTaskGroup and wait for that
to complete.  This should be more efficient, and allow us
to expand where we use threads to really latency sensitive
places.  E.g. we can probably now use these in nanobench
for CPU .skp rendering.

Now that all threads are sharing the same pool, I think we
can remove most of the custom mechanism pathops tests use
to control threading.  They'll just ride on the global pool
with all other tests now.

This (temporarily?) removes the GPU multithreading feature
from DM, which we don't use.

On my desktop, DM runs a little faster (57s -> 55s) in
Debug, and a lot faster in Release (36s -> 24s).  The bots
show speedups of similar proportions, cutting more than a
minute off the N4/Release and Win7/Debug runtimes.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/531653002
2014-09-03 14:06:48 -07:00
reed
e5ea500d47 Hide fields in SkImageInfo
R=rmistry@google.com
TBR=bsalomon

Author: reed@google.com

Review URL: https://codereview.chromium.org/536003002
2014-09-03 11:54:58 -07:00
piotaixr
42b0dfeb29 The key for SkBitmapCache can now be genID+SkIRect
BUG=skia:2894
R=junov@chromium.org, reed@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/518983002
2014-09-03 11:33:13 -07:00
robertphillips
d982eb22d7 Replace SkPictureReplacementPlayback with GrRecordReplaceDraw
I think this is sufficiently specialized to keep it in Ganesh for the time being.

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/535953002
2014-09-03 11:04:31 -07:00
reed
2bdf1f56c3 Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/527073003/)
Reason for revert:
virtual gpu failures in layouttests

http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/23717

[6:6:0903/041147:1700960503:INFO:SkBitmap.cpp(1003)] ../../third_party/skia/src/core/SkBitmap.cpp:1003: failed assertion "fPixelRef->info() == pixelRef->info()"

[6:6:0903/041147:1700961002:FATAL:SkBitmap.cpp(1003)] SK_CRASH
#0 0x7f9867df2c1e base::debug::StackTrace::StackTrace()
#1 0x7f9867e89e05 logging::LogMessage::~LogMessage()
#2 0x7f98689c4970 SkDebugf_FileLine()
#3 0x7f986870ebc6 SkBitmap::deepCopyTo()
#4 0x7f98690a3b6d blink::deepSkBitmapCopy()
#5 0x7f98690a3abe blink::ImageBuffer::copyImage()
#6 0x7f985fd4479e blink::ImageBitmap::ImageBitmap()
#7 0x7f985fd45942 blink::ImageBitmap::create()
#8 0x7f985fd84fdc blink::ImageBitmapFactories::createImageBitmap()
#9 0x7f985fd84d11 blink::ImageBitmapFactories::createImageBitmap()
#10 0x7f985ec9a7f2 blink::LocalDOMWindowV8Internal::createImageBitmap13Method()
#11 0x7f985ec96b0c blink::LocalDOMWindowV8Internal::createImageBitmapMethod()
#12 0x7f985ec91954 blink::LocalDOMWindowV8Internal::createImageBitmapMethodCallback()
#13 0x7f9869955af0 v8::internal::FunctionCallbackArguments::Call()
#14 0x7f98699833bd v8::internal::Builtin_HandleApiCall()

Original issue's description:
> Add gamma/sRGB tag to SkImageInfo
>
> This reverts commit 1cbc68f965.
>
> requires this to land in blink https://codereview.chromium.org/531883002/
>
> Committed: https://skia.googlesource.com/skia/+/2f6abdecc5c2f21da13003c615903679abc73fc7

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/535113002
2014-09-03 05:48:56 -07:00
reed
2f6abdecc5 Add gamma/sRGB tag to SkImageInfo
This reverts commit 1cbc68f965.

requires this to land in blink https://codereview.chromium.org/531883002/

R=fmalita@google.com, reed@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/527073003
2014-09-02 21:56:40 -07:00
mtklein
937c9c7eb4 Fix drawPosText() bounds bug.
We didn't catch this in our local tests because we tend to use default
kUTF8_TextEncoding with single-byte characters, which means N == byteLength.

BUG=409110
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/531933002
2014-09-02 15:19:48 -07:00
jvanverth
17a845f760 Fix matrix similarity test on arm64
Addresses precision issue by using a simpler test.
Also fixes issues with IvMatrix::preservesRightAngles, and adds unit tests.

BUG=skia:2405
R=robertphillips@google.com, egdaniel@google.com, djsollen@google.com, reed@google.com

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/520123002
2014-09-02 13:15:41 -07:00
reed
848250415e make allocPixels throw on failure
BUG=skia:
R=mtklein@google.com, fmalita@google.com, fmalita@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/510423005
2014-09-02 12:50:45 -07:00
mtklein
00f30bdc9e SkRecordPartialDraw with less code duplication
BUG=skia:
R=robertphillips@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/527423002
2014-09-02 12:03:31 -07:00
piotaixr
aca21d6d2f Rename ScaledImageCache.cpp to SkResourceCacheTest.cpp
BUG=skia:
R=junov@chromium.org, reed@android.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/518213003
2014-09-02 11:51:00 -07:00
reed
1cbc68f965 Revert of Revert of Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/532583002/)
Reason for revert:
linux_blink_rel

[ RUN      ] DeferredImageDecoderTest.drawIntoSkPicture
../../third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp:172: Failure
Value of: canvasBitmap.getColor(0, 0)
Actual: 0
Expected: static_cast<SkColor>( (static_cast<U8CPU>(255) << 24) | (static_cast<U8CPU>(255) << 16) | (static_cast<U8CPU>(255) << 8) | (static_cast<U8CPU>(255) << 0))
Which is: 4294967295
[  FAILED  ] DeferredImageDecoderTest.drawIntoSkPicture (0 ms)
[1457/1458] DeferredImageDecoderTest.drawIntoSkPicture (0 ms)
[ RUN      ] DeferredImageDecoderTest.decodeOnOtherThread
../../third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp:233: Failure
Value of: canvasBitmap.getColor(0, 0)
Actual: 0
Expected: static_cast<SkColor>( (static_cast<U8CPU>(255) << 24) | (static_cast<U8CPU>(255) << 16) | (static_cast<U8CPU>(255) << 8) | (static_cast<U8CPU>(255) << 0))
Which is: 4294967295
[  FAILED  ] DeferredImageDecoderTest.decodeOnOtherThread (1 ms)
[1458/1458] DeferredImageDecoderTest.decodeOnOtherThread (1 ms)
Retrying 2 tests (retry #2)

Original issue's description:
> Revert of Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/525113005/)
>
> Reason for revert:
> Experiment to see resulting failures
>
> Original issue's description:
> > Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/522813002/)
> >
> > Reason for revert:
> > seems to be breaking layout tests in roll
> >
> > Original issue's description:
> > > Add gamma/sRGB tag to SkImageInfo
> > >
> > > This reverts commit 64ba5fa1ff.
> > >
> > > BUG=skia:
> > >
> > > Committed: https://skia.googlesource.com/skia/+/c89aa509d6a094bc1b18d73135343819903a9cfb
> >
> > TBR=reed@google.com
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/b44c1895afae516cb851cd1a0cea83343c354ee4
>
> TBR=reed@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4581828014eb3d015e6ed55c9a5b6932b8751818

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

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/524593005
2014-09-02 04:14:37 -07:00
reed
4581828014 Revert of Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/525113005/)
Reason for revert:
Experiment to see resulting failures

Original issue's description:
> Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/522813002/)
>
> Reason for revert:
> seems to be breaking layout tests in roll
>
> Original issue's description:
> > Add gamma/sRGB tag to SkImageInfo
> >
> > This reverts commit 64ba5fa1ff.
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/c89aa509d6a094bc1b18d73135343819903a9cfb
>
> TBR=reed@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/b44c1895afae516cb851cd1a0cea83343c354ee4

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

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/532583002
2014-09-01 18:36:24 -07:00
reed
b44c1895af Revert of Add gamma/sRGB tag to SkImageInfo (patchset #1 id:1 of https://codereview.chromium.org/522813002/)
Reason for revert:
seems to be breaking layout tests in roll

Original issue's description:
> Add gamma/sRGB tag to SkImageInfo
>
> This reverts commit 64ba5fa1ff.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c89aa509d6a094bc1b18d73135343819903a9cfb

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

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/525113005
2014-09-01 14:28:32 -07:00
reed
c89aa509d6 Add gamma/sRGB tag to SkImageInfo
This reverts commit 64ba5fa1ff.

BUG=skia:
R=reed@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/522813002
2014-09-01 12:14:29 -07:00
robertphillips
a8d7f0b13c Try out scalar picture sizes
This paves the way for removing the 'fTile' parameter from SkPictureShader (although that should be a different CL). If we like this we could also move to providing an entire cull SkRect.

R=reed@google.com, mtklein@google.com, fmalita@google.com, fmalita@chromium.org

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/513983002
2014-08-29 08:03:56 -07:00
reed
64ba5fa1ff Revert of Add gamma/sRGB tags to SkImageInfo (patchset #1 of https://codereview.chromium.org/517123002/)
Reason for revert:
Seems to be triggering assert in blink

SSLUITest.TestRedirectHTTPToBadHTTPS (run #1):
[ RUN      ] SSLUITest.TestRedirectHTTPToBadHTTPS
HTTP server started on http://127.0.0.1:58000...
sending server_data: {"host": "127.0.0.1", "port": 58000} (36 bytes)
HTTPS server started on https://127.0.0.1:58009...
sending server_data: {"host": "127.0.0.1", "port": 58009} (36 bytes)
ASSERTION FAILED: info.fAlphaType == m_imageInfo.fAlphaType
../../third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp(78) : virtual bool blink::DecodingImageGenerator::onGetPixels(const SkImageInfo &, void *, size_t, SkPMColor *, int *)
1   0x77eb0d3 blink::DecodingImageGenerator::onGetPixels(SkImageInfo const&, void*, unsigned long, unsigned int*, int*)
2   0x92edddc SkImageGenerator::getPixels(SkImageInfo const&, void*, unsigned long, unsigned int*, int*)
3   0x92adf78 SkDiscardablePixelRef::onNewLockPixels(SkPixelRef::LockRec*)
4   0x9369283 SkPixelRef::lockPixels(SkPixelRef::LockRec*)
5   0x9369433 SkPixelRef::lockPixels()
6   0x9213344 SkBitmap::lockPixels() const
7   0x921ca57 SkAutoLockPixels::SkAutoLockPixels(SkBitmap const&, bool)
8   0x921ad80 SkAutoLockPixels::SkAutoLockPixels(SkBitmap const&, bool)
9   0x92b7125 SkDraw::drawBitmap(SkBitmap const&, SkMatrix const&, SkPaint const&) const
10  0x921f4fb SkBitmapDevice::drawBitmap(SkDraw const&, SkBitmap const&, SkMatrix const&, SkPaint const&)
11  0x921f8c7 SkBitmapDevice::drawBitmapRect(SkDraw const&, SkBitmap const&, SkRect const*, SkRect const&, SkPaint const&, SkCanvas::DrawBitmapRectFlags)
12  0x9288e12 SkCanvas::internalDrawBitmapRect(SkBitmap const&, SkRect const*, SkRect const&, SkPaint const*, SkCanvas::DrawBitmapRectFlags)
13  0x9288ee9 SkCanvas::drawBitmapRectToRect(SkBitmap const&, SkRect const*, SkRect const&, SkPaint const*, SkCanvas::DrawBitmapRectFlags)

Original issue's description:
> Add gamma/sRGB tags to SkImageInfo
>
> requires this CL to land in chrome
> https://codereview.chromium.org/517803002/
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/228b285ba14a6e9b6d1cc95ea1583caab30168a1

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/519583004
2014-08-29 07:50:28 -07:00
reed
228b285ba1 Add gamma/sRGB tags to SkImageInfo
requires this CL to land in chrome
https://codereview.chromium.org/517803002/

BUG=skia:
R=fmalita@google.com, fmalita@chromium.org, reed@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/517123002
2014-08-29 04:08:43 -07:00
reed
088f4b8eb3 Revert of Revert of Revert of add gamma/sRGB to SkImageInfo (patchset #1 of https://codereview.chromium.org/511363002/)
Reason for revert:
android builder in chrome reveals the caller using { } initialization for SkImageInfo, which this CL now makes illegal. Will have to fix the call site before I can re-land this

Original issue's description:
> Revert of Revert of add gamma/sRGB to SkImageInfo (patchset #1 of https://codereview.chromium.org/512243002/)
>
> Reason for revert:
> this revert was premature -- the chrome canary I looked at is old, and newer ones were green. So trying again...
>
> Original issue's description:
> > Revert of add gamma/sRGB to SkImageInfo (patchset #4 of https://codereview.chromium.org/514753002/)
> >
> > Reason for revert:
> > breaks linker on chrome -- may need SK_API, but not sure.
> >
> > Original issue's description:
> > > add gamma/sRGB to SkImageInfo
> > >
> > > BUG=skia:
> > >
> > > Committed: https://skia.googlesource.com/skia/+/615c369777258231054840a88cdb74c68c382485
> >
> > TBR=bungeman@google.com,bsalomon@google.com
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/dc53701216c0e9f98eacf6c0cda769ebbd200b59
>
> TBR=bungeman@google.com,bsalomon@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e759a2662273fdf52ebbb3822229945eda317e46

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/517113002
2014-08-28 14:46:19 -07:00
humper
d73c169637 Second attempt to land the integral image scaling change.
Scale all images to the nearest rounded integer, and if there's still
any scaling factor left over, pass it on to the subsequent bilerp code.
Should avoid artifacts when tiling scaled images.

Original CL received an LGTM from reed; new version disabled tiling
in the downsamplebitmap GM; I verified that this fixes the issue
we were seeing there on non-neon androids.

BUG=skia:2888
R=reed@android.com
TBR=reed

Author: humper@google.com

Review URL: https://codereview.chromium.org/514383003
2014-08-28 14:27:42 -07:00
mtklein
0209e95cc2 Align all SkRecord::alloc() calls up to at least a pointer size.
This should make the LSAN bots able to see all our pointers.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/517073002
2014-08-28 14:10:05 -07:00
bsalomon
23b406cc04 Make SkGpuDevice constructors private.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/517033002
2014-08-28 14:06:42 -07:00
bsalomon
b17c129108 Add dirty_after_edit to SkPath::moveTo. Add commented out test case that triggers assert.
BUG=skia:1460
R=reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/517023003
2014-08-28 14:04:55 -07:00
reed
011f39aeb2 rename ScaledImageCache to ResourceCache
BUG=skia:
R=bsalomon@google.com, mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/511283002
2014-08-28 13:35:23 -07:00
reed
e759a26622 Revert of Revert of add gamma/sRGB to SkImageInfo (patchset #1 of https://codereview.chromium.org/512243002/)
Reason for revert:
this revert was premature -- the chrome canary I looked at is old, and newer ones were green. So trying again...

Original issue's description:
> Revert of add gamma/sRGB to SkImageInfo (patchset #4 of https://codereview.chromium.org/514753002/)
>
> Reason for revert:
> breaks linker on chrome -- may need SK_API, but not sure.
>
> Original issue's description:
> > add gamma/sRGB to SkImageInfo
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/615c369777258231054840a88cdb74c68c382485
>
> TBR=bungeman@google.com,bsalomon@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/dc53701216c0e9f98eacf6c0cda769ebbd200b59

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/511363002
2014-08-28 11:57:34 -07:00
humper
60cc7d353b manual revert of bitmap scale change while I investigate failures
on chromeos

TBR=reed
NOTREECHECKS=True

Author: humper@google.com

Review URL: https://codereview.chromium.org/516923003
2014-08-28 09:54:41 -07:00
bsalomon
744998e666 Make textures register with GrResourceCache2 as scratch.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/510053003
2014-08-28 09:54:34 -07:00
reed
dc53701216 Revert of add gamma/sRGB to SkImageInfo (patchset #4 of https://codereview.chromium.org/514753002/)
Reason for revert:
breaks linker on chrome -- may need SK_API, but not sure.

Original issue's description:
> add gamma/sRGB to SkImageInfo
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/615c369777258231054840a88cdb74c68c382485

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/512243002
2014-08-28 06:53:19 -07:00
reed
615c369777 add gamma/sRGB to SkImageInfo
BUG=skia:
R=bungeman@google.com, bsalomon@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/514753002
2014-08-28 05:56:37 -07:00
mtklein
90e8457ab3 Increase test tolerance.
NOTREECHECKS=true

CQ_EXTRA_TRYBOTS=tryserver.skia:Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Release-Trybot

BUG=skia:
R=mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/516503003
2014-08-28 05:14:31 -07:00
Mike Klein
5ff9132693 More test debugging. Too close for decimal. I'm switching to hex.
BUG=skia:

Review URL: https://codereview.chromium.org/515753005
2014-08-28 07:15:32 -04:00
Mike Klein
56fa442503 Add some debugging to figure out what's up with failing Mac 10.8 Release bot.
BUG=skia:

Review URL: https://codereview.chromium.org/511013002
2014-08-27 19:08:52 -04:00
halcanary
daefa5b340 JPEG(JFIF only) directly embedded into PDF
R=reed@google.com, djsollen@google.com, mtklein@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/515493003
2014-08-27 13:00:54 -07:00
mtklein
d72094d1c1 Add test that confirms Pictures don't leak pixel refs.
Have been investigating memory leak failures that show SkRecords'
ImmutableBitmap copy leaking.  I think this test proves its not
an obvious problem with ImmutableBitmap or SkRecord.

http://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%282%29/builds/2509/steps/interactive_ui_tests/logs/stdio

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/516593002
2014-08-27 12:12:23 -07:00
robertphillips
d62833079f Switch GPU Optimization code to SkRecord
R=mtklein@google.com, bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/504393002
2014-08-27 11:53:28 -07:00
mtklein
533eb782ed Convert BBH APIs to use SkRect.
Still TODO: convert internals of SkTileGrid.cpp and SkRTree.cpp to work in floats too.

NOTREECHECKS=true

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/511613002
2014-08-27 10:39:42 -07:00
humper
ce7b1d5fad always scale to an integer; compensate for fractional image sizes by leaving the fractional scale in the matrix
BUG=skia:
R=reed@google.com

Author: humper@google.com

Review URL: https://codereview.chromium.org/470233002
2014-08-27 07:56:49 -07:00
mtklein
2a65a238b0 Remove SkQuadTree.
We're not testing it to the same degree we do RTree and TileGrid.  Any changes
we'll make to BBH APIs become 33% easier without it.  If find we want it again,
we can always resurrect it.

BUG=skia:1021,skia:2834
R=robertphillips@google.com, mtklein@google.com
TBR=reed

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/500373005
2014-08-26 14:07:04 -07:00
bsalomon
169612621f Make GrGpuResources register with GrResourceCache2 after fully constructed.
Committed: https://skia.googlesource.com/skia/+/d68b3e491bb765beb7ca5e4ac8e0c80dedf5a83b

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/504313002
2014-08-26 14:01:07 -07:00
bsalomon
a2b0af82f0 Revert of Make GrGpuResources register with GrResourceCache2 after fully constructed. (patchset #3 of https://codereview.chromium.org/504313002/)
Reason for revert:
Breaking the bots

Original issue's description:
> Make GrGpuResources register with GrResourceCache2 after fully constructed.
>
> Committed: https://skia.googlesource.com/skia/+/d68b3e491bb765beb7ca5e4ac8e0c80dedf5a83b

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

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/488463004
2014-08-26 13:11:11 -07:00
bsalomon
d68b3e491b Make GrGpuResources register with GrResourceCache2 after fully constructed.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/504313002
2014-08-26 12:51:20 -07:00
piotaixr
fac4e0e836 Fallback to moveTo when unable to find the first tangent in cubicTo
When calling cubicTo(a, b, c) and if the distance between fPrevPt and a
is too small, b is used instead of a to calculate the first tangent,
even if the distance between fPrevPt and b is too small.

In debug mode, this is causing an assertion to fail in
SkPathStroker::preJoinTo() and, in Release, the use of an
unitialized value.

The first patch set is adding a failing test.
The second one add the fix to SkPathStroker::cubicTo()

BUG=skia:2820
R=bsalomon@chromium.org, junov@chromium.org, reed@google.com, caryclark@google.com, bsalomon@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/460813002
2014-08-26 11:59:04 -07:00
reed
99ae881a7f remove (unused) scale parameter from measureText
BUG=skia:
R=bungeman@google.com, djsollen@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/510433002
2014-08-26 11:30:01 -07:00
halcanary
1790e25e18 SkAutoTDelete::operator T*()
R=reed@google.com, bungeman@google.com, mtklein@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/506963002
2014-08-26 11:06:25 -07:00
reed
680fb9e8f1 retool image cache to be generic cache, allowing the client to subclass "Rec", so they can provide a custom Key and arbitrary Value.
Follow-on CLs

- rename ScaledimageCache to something like GeneralCache
- explore if we can use call-backs or some mechanism to completely hide "lock/unlock", by forcing all clients to support "copying" their value out of the cache as the result of a Find.

R=mtklein@google.com, senorblanco@google.com, bsalomon@google.com, qiankun.miao@intel.com, senorblanco@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/507483002
2014-08-26 09:08:04 -07:00
kkinnunen
ec56e45454 Implement NV_path_rendering on OpenGL ES
Implement support for NV_path_rendering on OpenGL ES. Use
glProgramPathFragmentInputGenNV function call instead of glPathTexGenNV to
communicate transforms to fragment shader.

The intention is that the NVPR paths will be drawn with the same shader program
as non-NVPR geometry. For NVPR calls, the GPU will skip the vertex shader and
just run the fragment shader.

After program is linked, query the locations of the fragment shader inputs with
glGetResourceLocation. The location will be used to set the transforms with
glProgramPathFragmentInputGenNV.

The functions and their workings are documented in:

glProgramPathFragmentInputGenNV
https://www.opengl.org/registry/specs/NV/path_rendering.txt
(note: addition as of API version 1.3)

glGetResourceLocation
https://www.opengl.org/registry/specs/ARB/program_interface_query.txt
http://www.opengl.org/registry/doc/glspec44.core.pdf
(function is in core Open GL 4.4)

Note: glProgramPathFragmentInputGenNV could be used also for OpenGL. However,
using seems to trigger a bug in the driver. Disable this feature on OpenGL at
least until the driver is fixed and released. The bug manifests in shadertext
test, where the lower-left text pair is missing. Valgrind catches a bad read
for the test and causes the context to OOM reproducibly.

R=bsalomon@google.com, cdalton@nvidia.com, joshualitt@google.com, joshualitt@chromium.org

Author: kkinnunen@nvidia.com

Review URL: https://codereview.chromium.org/367643004
2014-08-25 22:21:16 -07:00
senorblanco
1150a6d151 Fix recursive computation of filter bounds for drop shadow,
morphology, blur.

[Reland with fixed tests.]

Because we're computing "backwards" from a clip rect of destination
pixels to be filled to the required source pixels, we should use tail
recursion rather than head recursion in onFilterBounds().

This actually only makes a difference for drop-shadow, where
the computation is non-commutative. Blur and morphology commute, but I
moved them to tail recursion anyway for clarity (so all onFilterBounds
use tail recursion).

BUG=skia:
R=bsalomon@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/481273005
2014-08-25 12:46:58 -07:00
bungeman
a6785ccb54 Add a working SkFontMgr_fontconfig.
R=tomhudson@google.com, reed@google.com, mtklein@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/396143004
2014-08-25 12:00:49 -07:00
djsollen
38cb688bd0 Revert of Fix recursive computation of filter bounds for drop shadow, (patchset #1 of https://codereview.chromium.org/481273005/)
Reason for revert:
This CL is currently breaking the Win7 and Win8 bots on some of the new tests (in DM).

Original issue's description:
> Fix recursive computation of filter bounds for drop shadow,
> morphology, blur.
>
> Because we're computing "backwards" from a clip rect of destination
> pixels to be filled to the required source pixels, we should use tail
> recursion rather than head recursion in onFilterBounds().
>
> This actually only makes a difference for drop-shadow, where
> the computation is non-commutative. Blur and morphology commute, but I
> moved them to tail recursion anyway for clarity (so all onFilterBounds
> use tail recursion).
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/28648fe4a69b0cee8df42b5966e4e645c3aabefb

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

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/504773003
2014-08-25 09:06:19 -07:00
senorblanco
28648fe4a6 Fix recursive computation of filter bounds for drop shadow,
morphology, blur.

Because we're computing "backwards" from a clip rect of destination
pixels to be filled to the required source pixels, we should use tail
recursion rather than head recursion in onFilterBounds().

This actually only makes a difference for drop-shadow, where
the computation is non-commutative. Blur and morphology commute, but I
moved them to tail recursion anyway for clarity (so all onFilterBounds
use tail recursion).

BUG=skia:
R=bsalomon@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/481273005
2014-08-25 08:06:57 -07:00
mtklein
5f0e82204e Support comment groups in SkRecord.
This should fix the failing paint-command-log-nodes.html layout test.

BUG=406425
R=tomhudson@chromium.org

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/501533003
2014-08-22 11:44:26 -07:00
mtklein
d910f54443 Fix saveLayer() with a pixel-moving filter vs SkBBoxHierarchyRecord / SkRecordDraw
In SkBBoxHierarchyRecord:
  Since the bounds we pass to saveLayer are in the pre-filtering
  coordinate space, they aren't correct for determining the actual
  device pixels touched by the saveLayer in this case.

  The easiest fix for now is to pass the clip bounds, since the final
  draw done in restore() will never draw outside the clip.

In SkRecordDraw:
  We do adjust the bounds passed to saveLayer, so we just need to make
  sure that when we're using a paint that may affect transparent black,
  we ignore the calculated bounds of draw ops and use the clip intersected
  with those adjusted bounds.

See originally crrev.com/497773002

BUG=skia:
R=reed@google.com, senorblanco@chromium.org, junov@chromium.org, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/496963003
2014-08-22 09:06:34 -07:00
fmalita
51bf9573b8 Add some text blob bounds unit tests.
R=robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/498693002
2014-08-22 07:50:46 -07:00
joshualitt
30ba436f04 Initial refactor of shaderbuilder to prepare for geometry shaders
gitignore for eclipse

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

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/491673002
2014-08-21 20:18:45 -07:00
fmalita
c6765d69e3 Add some SkTextBlob builder tests.
R=reed@google.com, robertphillips@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/493443004
2014-08-21 15:03:04 -07:00
mtklein
c92e550d36 Install a hook to swap between SkPicture backends with a single define.
BUG=skia:
R=robertphillips@google.com, reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/492023002
2014-08-21 13:07:27 -07:00
reed
04617139f7 expose generalized imagecache key
BUG=skia:
R=mtklein@google.com, halcanary@google.com, qiankun.miao@intel.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/483493003
2014-08-21 09:46:49 -07:00
mtklein
53fecfb15d Our SkPicture::Analysis visitors should recurse into nested pictures.
BUG=skia:
R=tomhudson@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/495793002
2014-08-21 09:11:38 -07:00
reed
9fa60daad4 Simplify flattening to just write enough to call the factory/public-constructor for the class. We want to *not* rely on private constructors, and not rely on calling through the inheritance hierarchy for either flattening or unflattening(CreateProc).
Refactoring pattern:

1. guard the existing constructor(readbuffer) with the legacy build-flag
2. If you are a instancable subclass, implement CreateProc(readbuffer) to create a new instances from the buffer params (or return NULL).

If you're a shader subclass
1. You must read/write the local matrix if your class accepts that in its factory/constructor, else ignore it.

R=robertphillips@google.com, mtklein@google.com, senorblanco@google.com, senorblanco@chromium.org, sugoi@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/395603002
2014-08-21 07:59:51 -07:00
djsollen
a8d2c4adb8 Temporarily adjust Matrix.isSimilarity test tolerance on 64-bit ARM devices
BUG=skia:2405
R=halcanary@google.com, jvanverth@google.com, reed@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/494113002
2014-08-21 07:40:43 -07:00
mtklein
c551d9fcae Implement SkPicture::hasText() for SkRecord backend.
Plus, some small tweaks to the existing code surrounding it.  Just proposals,
will undo whatever you don't like.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/494683003
2014-08-20 08:09:46 -07:00
reed
b88813683c fix Image::isOpaque test to not leak
BUG=skia:
R=halcanary@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/495523002
2014-08-20 07:24:01 -07:00
tomhudson
3a0f279167 Move the code over using the same template type approach previously used for willPlayBackBitmaps in http://skbug.com/2702.
Also unifies that flag and this one into a struct so they and others can be computed together. The struct is stored const to enforce lifetime expectations. Adds a few new cases to the unit test.

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

Committed: https://skia.googlesource.com/skia/+/60c2a79cfa8ceebcbafc243407564dc71f5e3b4f

Author: tomhudson@chromium.org

Review URL: https://codereview.chromium.org/364823009
2014-08-20 05:29:41 -07:00
piotaixr
d2a3522503 Add the method isOpaque() to SkImage
BUG=skia:2766
R=junov@chromium.org, halcanary@google.com, scroggo@google.com, reed@google.com, bsalomon@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/406673003
2014-08-19 14:29:02 -07:00
caryclark
38dd9f2e41 remove unused SkIntToFloatCast_NoOverflowCheck
R=reed@google.com, reed
BUG=skia:2849

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/483273003
2014-08-19 07:39:41 -07:00
halcanary
97d2c0a216 Move SkReadBuffer.h and SkReader32.h out of include.
Committed: https://skia.googlesource.com/skia/+/2a51d7c74cec217195f861677de8998b382b39e4

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

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/481053002
2014-08-19 06:27:53 -07:00
Mike Klein
27dc17c297 Revert "Move the code over using the same template type approach previously used for willPlayBackBitmaps in http://skbug.com/2702."
This reverts commit 60c2a79cfa.

BUG=skia:

Review URL: https://codereview.chromium.org/481173003
2014-08-18 18:35:16 -04:00
tomhudson
60c2a79cfa Move the code over using the same template type approach previously used for willPlayBackBitmaps in http://skbug.com/2702.
Also unifies that flag and this one into a struct so they and others can be computed together. The struct is stored const to enforce lifetime expectations. Adds a few new cases to the unit test.

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

Author: tomhudson@chromium.org

Review URL: https://codereview.chromium.org/364823009
2014-08-18 15:07:13 -07:00
halcanary
f128f53a5b Revert "Move SkReadBuffer.h and SkReader32.h out of include."
This reverts commit 2a51d7c74c.

Breaking Blink

NOTRY=true
R=bungeman@google.com
TBR=bungeman@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/472303006
2014-08-18 13:48:13 -07:00
mtklein
3e8232b6ef Counterproposal for skirting the BBH when the query fully contains the picture.
BUG=skia:
R=reed@google.com, robertphillips@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/485703002
2014-08-18 13:39:11 -07:00
halcanary
2a51d7c74c Move SkReadBuffer.h and SkReader32.h out of include.
R=mtklein@google.com, reed@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/481053002
2014-08-18 13:04:59 -07:00
ajuma
750ae26745 Expose API for whether an SkPicture contains text
BUG=chromium:399728
R=reed@google.com, nduca@chromium.org

Author: ajuma@chromium.org

Review URL: https://codereview.chromium.org/478673002
2014-08-18 12:59:55 -07:00
mtklein
62b67ae96e Start actually bounding some draw ops.
This covers most of the common draws.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/469213007
2014-08-18 11:10:37 -07:00
robertphillips
6617d509ab Rename GPUAccelData to GrAccelData
This is calved off of (Add new API to allow layer hoisting/atlasing across picture piles
- https://codereview.chromium.org/474623002/)

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/482773002
2014-08-18 09:39:34 -07:00
robertphillips
6f294af43b Refactor GrLayerCache for new API
The only substantive change in this CL is skipping atlasing
for any layers that are involved in nesting. Prior versions
have allowed nesting layers to be atlased.

--------------------------------------------------------

All times are on Windows with a repeat count of 200.
Format is: <time in ms> (<# of glBindframebuffer calls>)

How to interpret this:

For the boogie page:

 both columns should be the same (since boogie has no
        nested layers)
 without the new API the tiled case doesn't show any real
        benefit from hoisting

For the carsvg page:

 The nesting change does increase the number of FBO
      switches but doesn't kill performance
 Because of the location & size of the layers the
      tile case does show some improvement (even
      without the new API)

boogie
-------

		   w/o nested change   w/ nested change

simple                5.62 (811)           N/A

tiled                 7.72 (811)           N/A

simple w/ hoisting    5.23 (409)        5.77 (409)
(but no caching)

tiled w/ hoisting     7.57 (809)        7.49 (809)
(but no caching)

carsvg
------

		   w/o nested change   w/ nested change

simple 		      60.37 (141990)        N/A

tiled                115.13 (256929)        N/A

simple w/ hoisting    41.57 (64570)      42.82 (72279)
(but no caching)

tiled w/ hoisting     84.24 (154352)     84.71 (165630)
(but no caching)

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/476833004
2014-08-18 08:50:03 -07:00
halcanary
ea4673fde6 SkImage::NewFromGenerator(SkImageGenerator*), and a unit test.
R=reed@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/465823003
2014-08-18 08:27:09 -07:00
mtklein
a723b576ae SkRecordDraw: incorporate clip into BBH
NOTREECHECKS=true

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/474983002
2014-08-15 11:49:49 -07:00
djsollen
3b6255493e Remove SkPaintOptionsAndroid
Committed: https://skia.googlesource.com/skia/+/f32331ffdb5de0440bb337aa7cbdd6f33e9ff23b

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

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/447873003
2014-08-14 06:29:03 -07:00
bsalomon
c15e28a522 Revert of Remove SkPaintOptionsAndroid (patchset #5 of https://codereview.chromium.org/447873003/)
Reason for revert:
Breaks the Chromium build: http://108.170.220.120:10117/builders/Canary-Chrome-Ubuntu13.10-Ninja-x86_64-DRT/builds/2469/steps/BuildContentShell_1/logs/stdio

Original issue's description:
> Remove SkPaintOptionsAndroid
>
> Committed: https://skia.googlesource.com/skia/+/f32331ffdb5de0440bb337aa7cbdd6f33e9ff23b

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

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/473543004
2014-08-13 15:18:46 -07:00
djsollen
f32331ffdb Remove SkPaintOptionsAndroid
R=reed@google.com, mtklein@google.com, tomhudson@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/447873003
2014-08-13 13:09:49 -07:00
halcanary
2512372b68 fix win compiler div/zero
R=bsalomon@google.com
TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/474433002
2014-08-13 09:20:08 -07:00