platform/upstream/libSkiaSharp.git
9 years agoRevert of removing GrDrawEffect (patchset #4 id:60001 of https://codereview.chromium...
joshualitt [Tue, 16 Sep 2014 14:17:28 +0000 (07:17 -0700)]
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

9 years agoremoving GrDrawEffect
joshualitt [Tue, 16 Sep 2014 13:46:30 +0000 (06:46 -0700)]
removing GrDrawEffect

BUG=skia:
R=bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/571163002

9 years agoAttach GrOptDrawState into shader building pipeline
egdaniel [Tue, 16 Sep 2014 13:34:42 +0000 (06:34 -0700)]
Attach GrOptDrawState into shader building pipeline

The OptDrawState is now used for creating the actual gl shader. Current
optimizations dones in GrOptDrawState include:
All blend optimizations
Constant color/coverage stage optimizations

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

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/504203004

9 years agoAlways disable the scissor test before BlitFrameBuffer
derekf [Tue, 16 Sep 2014 13:24:57 +0000 (06:24 -0700)]
Always disable the scissor test before BlitFrameBuffer

It seems most (all?) implementations of BlitFrameBuffer actually
obey the scissor test, so just always disable the scissor before
calling BlitFrameBuffer.

Original Author: Henry Song <henrysong@samsung.com>

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

Author: derekf@osg.samsung.com

Review URL: https://codereview.chromium.org/574543002

9 years agoFix incorrect Rec601 YUV conversion matrix coefficient.
rileya [Tue, 16 Sep 2014 13:23:50 +0000 (06:23 -0700)]
Fix incorrect Rec601 YUV conversion matrix coefficient.

For future reference, the rec 601 matrix can be defined by the concatenation of these 2 matrices:

[1.164  0.0    1.596 0.0]
[1.164 -0.391 -0.813 0.0]
[1.164  2.018  0.0   0.0]
[1.164  0.0    0.0   1.0]
See: http://www.fourcc.org/fccyvrgb.php

and

[1.0  0.0  0.0  -0.0625]
[0.0  1.0  0.0  -0.5   ]
[0.0  0.0  1.0  -0.5   ]
[0.0  0.0  0.0   1.0   ]
Which transforms Y by -0.0625 (-16/256) and U and V by
-0.5 (-128/256) each.

Giving us the final matrix:

[1.164  0.0    1.596  -0.87075]
[1.164 -0.391 -0.813   0.52925]
[1.164  2.018  0.0    -1.08175]
[0.0    0.0    0.0     1.0    ]

Which produces our output [R,G,B,A], when multiplied
with an input [Y,U,V,A].

R=bsalomon@google.com

Author: rileya@chromium.org

Review URL: https://codereview.chromium.org/545983006

9 years agoFix scaling issue with distance field text.
jvanverth [Tue, 16 Sep 2014 12:45:19 +0000 (05:45 -0700)]
Fix scaling issue with distance field text.

Picks the correct distance field size based on both the text size and
the max matrix scale. Adjusts the matrix scale if non-unity. Also adds
GM for verifying proper distance field scaling.

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

Author: jvanverth@google.com

Review URL: https://codereview.chromium.org/568843002

9 years agoPicture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame
yunchao.he [Tue, 16 Sep 2014 05:30:38 +0000 (22:30 -0700)]
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

9 years agoUpdate SKP version to 103
borenet [Tue, 16 Sep 2014 04:12:37 +0000 (21:12 -0700)]
Update SKP version to 103

Automatic commit by the RecreateSKPs bot.

TBR=

Author: borenet@google.com

Review URL: https://codereview.chromium.org/571293002

9 years agoFix leak in PictureNestingBench
fmalita [Tue, 16 Sep 2014 01:20:10 +0000 (18:20 -0700)]
Fix leak in PictureNestingBench

R=mtklein@google.com
TBR=mtklein@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/569313004

9 years agoNested picture nanobench
fmalita [Mon, 15 Sep 2014 23:46:16 +0000 (16:46 -0700)]
Nested picture nanobench

Measure picture overhead for recording & playback using a Sierpinski fractal (http://skfiddle.com/c/a2b6e60d775543b7c29a5d45d0371c02) with various picture nesting levels.

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

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/566393002

9 years agoSkRecord: clean up comments and 4 bytes per SkRecord.
mtklein [Mon, 15 Sep 2014 21:26:57 +0000 (14:26 -0700)]
SkRecord: clean up comments and 4 bytes per SkRecord.

Just happened to notice these while skimming through.  The comments are a
little out of date; now that we have visit/mutate, we do need O(1) random
access.

The constructor arguments are flexibility we're not using.

BUG=skia:
R=fmalita@google.com

Author: mtklein@skia.org

Review URL: https://codereview.chromium.org/569373002

9 years agoadd lua to histogram text lengths
reed [Mon, 15 Sep 2014 19:44:14 +0000 (12:44 -0700)]
add lua to histogram text lengths

NOTRY=True
R=bungeman@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/574493002

9 years agoSkPicture::PathCounter is O(N^2) for pictures nested N deep. Fix that.
mtklein [Mon, 15 Sep 2014 19:31:34 +0000 (12:31 -0700)]
SkPicture::PathCounter is O(N^2) for pictures nested N deep.  Fix that.

We've already done the analysis for child pictures.  Don't do it again.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/573833002

9 years agoBUG=skia:
joshualitt [Mon, 15 Sep 2014 18:41:13 +0000 (11:41 -0700)]
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

9 years agoChange SkResourceCache to take a Visitor inside its find().
reed [Mon, 15 Sep 2014 18:39:44 +0000 (11:39 -0700)]
Change SkResourceCache to take a Visitor inside its find().

This reverts commit 595aa05efcb504e85358b8d328ac4a9fa1c46e2e.

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/569353002

9 years agoFix recording of saveLayout with unusual Xfermodes.
dneto [Mon, 15 Sep 2014 17:53:16 +0000 (10:53 -0700)]
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

9 years agoRevert of Change SkResourceCache to take a Visitor inside its find(). (patchset ...
reed [Mon, 15 Sep 2014 17:15:18 +0000 (10:15 -0700)]
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

9 years agoAdd flag to call SkRecordOptimize on new pictures.
mtklein [Mon, 15 Sep 2014 16:28:54 +0000 (09:28 -0700)]
Add flag to call SkRecordOptimize on new pictures.

As usual it's enabled by default in the Skia tree.  Will flip in Chrome after this rolls.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/573773002

9 years agoadd dumpHex() option to SkPath
caryclark [Mon, 15 Sep 2014 16:26:09 +0000 (09:26 -0700)]
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

9 years agoRebaseline hittestpath and ignore flaky failure on TARUAD
Mike Klein [Mon, 15 Sep 2014 14:56:59 +0000 (10:56 -0400)]
Rebaseline hittestpath and ignore flaky failure on TARUAD

BUG=skia:2937

Review URL: https://codereview.chromium.org/571963002

9 years agoCreate an optimized draw state but not hooked in yet to gpu pipeline
egdaniel [Mon, 15 Sep 2014 14:01:59 +0000 (07:01 -0700)]
Create an optimized draw state but not hooked in yet to gpu pipeline

BUG=skia:
R=bsalomon@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/508663002

9 years agoChange SkResourceCache to take a Visitor inside its find().
reed [Mon, 15 Sep 2014 13:44:47 +0000 (06:44 -0700)]
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

9 years agoRevert of Picture Recording: fix the performance bottleneck in SkDeferredCanvas:...
mtklein [Mon, 15 Sep 2014 13:00:49 +0000 (06:00 -0700)]
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

9 years agoremove 'experimental' from using hash tables in resourcecache
reed [Mon, 15 Sep 2014 02:58:24 +0000 (19:58 -0700)]
remove 'experimental' from using hash tables in resourcecache

TBR=

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/567303002

9 years agoPicture Recording: fix the performance bottleneck in SkDeferredCanvas::isFullFrame
yunchao.he [Mon, 15 Sep 2014 01:59:04 +0000 (18:59 -0700)]
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

9 years agoAdd support for the Rec601 YUV color space to GrYUVtoRGBEffect.
rileya [Sat, 13 Sep 2014 00:45:58 +0000 (17:45 -0700)]
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

9 years agoRevert of Add a test that uses C++11 features as a compiler canary. (patchset #2...
mtklein [Sat, 13 Sep 2014 00:07:34 +0000 (17:07 -0700)]
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

9 years agoAdd a test that uses C++11 features as a compiler canary.
mtklein [Sat, 13 Sep 2014 00:02:51 +0000 (17:02 -0700)]
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

9 years agoDo not expect a copysign function to be defined in <cmath> with clang-cl
ehsan.akhgari [Fri, 12 Sep 2014 19:30:35 +0000 (12:30 -0700)]
Do not expect a copysign function to be defined in <cmath> with clang-cl

clang-cl defines __cplusplus to 201103L, but it uses the runtime library
provided by MSVC, so the copysign function will not be available there.

BUG=skia:
R=reed@google.com

Author: ehsan.akhgari@gmail.com

Review URL: https://codereview.chromium.org/526813002

9 years agoHandle NULL typeface in SkFontMgr_fontconfig::onMatchFaceStyle.
bungeman [Fri, 12 Sep 2014 19:14:14 +0000 (12:14 -0700)]
Handle NULL typeface in SkFontMgr_fontconfig::onMatchFaceStyle.

SampleApp does this, and it needs to be handled properly.

R=mtklein@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/563263003

9 years agouse SkData::NewUninitialized
reed [Fri, 12 Sep 2014 19:12:27 +0000 (12:12 -0700)]
use SkData::NewUninitialized

BUG=skia:
R=bungeman@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/565803005

9 years agoAdd *@skia.org to AUTHORS so we can land CLs using those addresses if we like.
mtklein [Fri, 12 Sep 2014 19:03:55 +0000 (12:03 -0700)]
Add *@skia.org to AUTHORS so we can land CLs using those addresses if we like.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/565293002

9 years agoLet SkTaskGroup work synchronously if no one created an SkTaskGroup::Enabler.
mtklein [Fri, 12 Sep 2014 16:35:56 +0000 (09:35 -0700)]
Let SkTaskGroup work synchronously if no one created an SkTaskGroup::Enabler.

Tested by running DM with its SkTaskGroup::Enabler commented out.  Slow, but completed correctly.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/556223003

9 years agoAdd more debugging for newly failing assert (DM on Xoom bots).
Mike Klein [Fri, 12 Sep 2014 16:17:25 +0000 (12:17 -0400)]
Add more debugging for newly failing assert (DM on Xoom bots).

BUG=skia:

Review URL: https://codereview.chromium.org/568823002

9 years agoremove confusing/unused stream methods
reed [Fri, 12 Sep 2014 15:49:54 +0000 (08:49 -0700)]
remove confusing/unused stream methods

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/563273003

9 years agoUpdate SKP version to 99
borenet [Fri, 12 Sep 2014 04:31:30 +0000 (21:31 -0700)]
Update SKP version to 99

Automatic commit by the RecreateSKPs bot.

TBR=

Author: borenet@google.com

Review URL: https://codereview.chromium.org/571443002

9 years agoClear away any lingering error before testing SkError.
mtklein [Thu, 11 Sep 2014 21:41:56 +0000 (14:41 -0700)]
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

9 years agoAdd --matrix to DM, to play around with and maybe use on a bot.
mtklein [Thu, 11 Sep 2014 19:30:12 +0000 (12:30 -0700)]
Add --matrix to DM, to play around with and maybe use on a bot.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/563723005

9 years agoadd PurgeResourceCache to track leaks
reed [Thu, 11 Sep 2014 19:22:34 +0000 (12:22 -0700)]
add PurgeResourceCache to track leaks

TBR=halcananry

Author: reed@google.com

Review URL: https://codereview.chromium.org/554263005

9 years agoDisable discardable memory for the resource cache until tests pass.
danakj [Thu, 11 Sep 2014 18:08:50 +0000 (11:08 -0700)]
Disable discardable memory for the resource cache until tests pass.

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

Author: danakj@chromium.org

Review URL: https://codereview.chromium.org/568493002

9 years agoMake SkBitmapCache remove invalid bitmaps from the SkResourceCache.
danakj [Thu, 11 Sep 2014 17:49:52 +0000 (10:49 -0700)]
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

9 years agoSkData can allocate room for its contents in the same block
reed [Thu, 11 Sep 2014 15:42:36 +0000 (08:42 -0700)]
SkData can allocate room for its contents in the same block

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/560653004

9 years agoAssert SkTDArray::pop() doesn't underflow.
mtklein [Thu, 11 Sep 2014 13:36:11 +0000 (06:36 -0700)]
Assert SkTDArray::pop() doesn't underflow.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/563633003

9 years agoUpdate SKP version to 98
borenet [Thu, 11 Sep 2014 04:25:40 +0000 (21:25 -0700)]
Update SKP version to 98

Automatic commit by the RecreateSKPs bot.

TBR=

Author: borenet@google.com

Review URL: https://codereview.chromium.org/559283002

9 years agoDelay any SkRecordOptimize until after SkRecord has stuck.
mtklein [Wed, 10 Sep 2014 23:40:05 +0000 (16:40 -0700)]
Delay any SkRecordOptimize until after SkRecord has stuck.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/561993002

9 years agoFix a bug in Save-Restore no-op optimization.
mtklein [Wed, 10 Sep 2014 23:08:27 +0000 (16:08 -0700)]
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

9 years agoRemove a layer of indirection and code from SkFontHost.
bungeman [Wed, 10 Sep 2014 22:49:48 +0000 (15:49 -0700)]
Remove a layer of indirection and code from SkFontHost.

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

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/105223006

9 years agoRevert of Added test for non cached ETC1 (patchset #2 id:20001 of https://codereview...
bungeman [Wed, 10 Sep 2014 21:59:59 +0000 (14:59 -0700)]
Revert of Added test for non cached ETC1 (patchset #2 id:20001 of https://codereview.chromium.org/564493002/)

Reason for revert:
This is causing dm and gm to crash on the Win8 7770 bots, for example

http://108.170.220.120:10117/builders/Test-Win8-ShuttleA-HD7770-x86-Debug/builds/2128

An example stack trace looks like

[13:46:16.260000]   -1M drawing... extractbitmap [600 600]
[13:46:16.760000]   -1M drawing... etc1bitmap_npot [124 124]
[13:46:16.760000]   -1M drawing... etc1bitmap_r11.ktx [128 128]
[13:46:16.760000]   -1M drawing... etc1bitmap_ktx [128 128]
[13:46:16.760000]   -1M drawing... etc1bitmap_pkm_volatile [128 128]
[13:46:16.760000]
[13:46:16.760000] Caught exception 3221225477 EXCEPTION_ACCESS_VIOLATION
[13:46:16.760000] sk_gr_allocate_texture +c9
[13:46:16.760000] load_etc1_texture +1dd
[13:46:16.760000] sk_gr_create_bitmap_texture +199
[13:46:16.760000] GrLockAndRefCachedBitmapTexture +ad
[13:46:16.760000] SkGpuDevice::SkAutoCachedTexture::set +5d
[13:46:16.760000] SkGpuDevice::SkAutoCachedTexture::SkAutoCachedTexture +65
[13:46:16.760000] SkGpuDevice::internalDrawBitmap +8e
[13:46:16.760000] SkGpuDevice::drawBitmapCommon +608
[13:46:16.760000] SkGpuDevice::drawBitmap +79
[13:46:16.760000] SkCanvas::internalDrawBitmap +11b
[13:46:16.760000] SkCanvas::drawBitmap +d3
[13:46:16.760000] skiagm::ETC1BitmapGM::onDraw +140
[13:46:16.760000] skiagm::GM::drawContent +3c
[13:46:16.760000] skiagm::GM::draw +24
[13:46:16.760000] GMMain::invokeGM +63
[13:46:16.760000] GMMain::generate_image +186
[13:46:16.760000] GMMain::test_drawing +5b
[13:46:16.760000] run_multiple_configs +2f9
[13:46:16.760000] tool_main +75d
[13:46:16.760000] main +16
[13:46:16.760000] __tmainCRTStartup +199
[13:46:16.760000] mainCRTStartup +d
[13:46:16.760000] BaseThreadInitThunk +e
[13:46:16.760000] RtlInitializeExceptionChain +84
[13:46:16.760000] RtlInitializeExceptionChain +5a

Original issue's description:
> Added test for non cached ETC1
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d9ec549071581d9d1dc2e5fac3163305ae935a39

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

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/559093003

9 years agoFixed void* to uint64_t cast on win64 in TraceID.
cjacek [Wed, 10 Sep 2014 21:28:06 +0000 (14:28 -0700)]
Fixed void* to uint64_t cast on win64 in TraceID.

On win64, long is 32-bit. Found by GCC (mingw-w64) build, where this causes an error.

This is the Skia version of https://codereview.chromium.org/374043002 .

R=bungeman@google.com, humper@google.com

Author: cjacek@gmail.com

Review URL: https://codereview.chromium.org/510923002

9 years agoAdded test for non cached ETC1
sugoi [Wed, 10 Sep 2014 20:40:18 +0000 (13:40 -0700)]
Added test for non cached ETC1

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

Author: sugoi@chromium.org

Review URL: https://codereview.chromium.org/564493002

9 years agoMeasure picture recording speed in nanobench.
mtklein [Wed, 10 Sep 2014 19:19:30 +0000 (12:19 -0700)]
Measure picture recording speed in nanobench.

Today we measure SkPicture playback speed, but not the time it takes to record
the SkPicture.  This fixes that by reading SKPs from disk and re-recording them.

On the console, recording shows up first as the nonrendering skp benches,
followed later by the usual playback benches:

maxrss  loops   min median  mean    max stddev  samples     config  bench
51M  2   165µs   168µs   169µs   178µs   3%  ▆▄▃█▂▄▁▂▁▁  nonrendering    tabl_slashdot.skp
57M  1   9.72ms  9.77ms  9.79ms  9.97ms  1%  █▂▂▅▃▂▁▄▂▁  nonrendering    desk_pokemonwiki.skp
57M  32  2.92µs  2.96µs  3.03µs  3.46µs  6%  ▅▁▁▁▁▁▁█▂▁  nonrendering    desk_yahoosports.skp
...
147M 1   3.86ms  3.87ms  3.97ms  4.81ms  7%  █▁▁▁▁▁▁▁▁▁  8888    tabl_slashdot.skp_1
147M 1   4.54ms  4.56ms  4.55ms  4.56ms  0%  █▅▇▅█▅▂▁▅▁  565     tabl_slashdot.skp_1
147M 2   3.08ms  3.24ms  4.17ms  8.18ms  50% █▁▁█▁▁▁▁▁▁  gpu     tabl_slashdot.skp_1
147M 1   1.61ms  1.62ms  1.69ms  2.33ms  13% █▁▁▁▁▁▁▁▁▁  8888    desk_pokemonwiki.skp_1
147M 1   1.44ms  1.44ms  1.45ms  1.47ms  1%  ▅▂█▂▂▅▁▁▂▁  565     desk_pokemonwiki.skp_1
...

On skiaperf.com, they'll also be separated out from playback benches by bench_type.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/559153002

9 years agoClean up old custom tools now subsumed by nanobench.
mtklein [Wed, 10 Sep 2014 19:11:22 +0000 (12:11 -0700)]
Clean up old custom tools now subsumed by nanobench.

BUG=skia:
R=mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/551263003

9 years agoDistinguish common and unique names for skiaperf.com.
mtklein [Wed, 10 Sep 2014 19:05:59 +0000 (12:05 -0700)]
Distinguish common and unique names for skiaperf.com.

Turns out we tack on the size post-facto in ResultsWriter::bench(), so the only
place we need getUniqueName() to differ from getName() is SKPBench.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/552303004

9 years agoFix iteration bounds of Android GL API initialization
tomhudson [Wed, 10 Sep 2014 17:45:42 +0000 (10:45 -0700)]
Fix iteration bounds of Android GL API initialization

A dormant error in https://codereview.chromium.org/319043005 was
exposed on some new platforms; this makes sure loop iterations
are bounded.

BUG=
R=joshualitt@google.com, joshualitt@chromium.org

Author: tomhudson@google.com

Review URL: https://codereview.chromium.org/557363002

9 years agomake set3DMask virtual, so we can safely notify the shadercontext
reed [Wed, 10 Sep 2014 17:20:24 +0000 (10:20 -0700)]
make set3DMask virtual, so we can safely notify the shadercontext

also boost preallocated storage to account for this combo of bitmapshader + emboss + colorfilter

BUG=skia:
R=djsollen@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/563563002

9 years agoExpectation file update for bot changes.
Mike Klein [Wed, 10 Sep 2014 15:10:48 +0000 (11:10 -0400)]
Expectation file update for bot changes.

BUG=skia:

Review URL: https://codereview.chromium.org/560873002

9 years agoDetect presence of dwrite_1.h.
bungeman [Wed, 10 Sep 2014 14:49:05 +0000 (07:49 -0700)]
Detect presence of dwrite_1.h.

This introduces the SK_HAS_DWRITE_1_H define which may be set at
build time or will be true when WINVER_MAXVER >= 0x0602 .

The dwrite_1.h header is available starting in Windows SDK 8.0.
This change supports users who must still use Windows SDK 7.0.
It also allows for easier local testing of the older interfaces
on newer versions of Windows.

See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1053652

R=george@mozilla.com, mtklein@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/552383002

9 years agodisable conservative rasterclip on gpu, until we understand perspective
reed [Wed, 10 Sep 2014 14:23:32 +0000 (07:23 -0700)]
disable conservative rasterclip on gpu, until we understand perspective

BUG=skia:
R=bsalomon@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/561763002

9 years agoUpdate SKP version to 97
borenet [Wed, 10 Sep 2014 04:14:51 +0000 (21:14 -0700)]
Update SKP version to 97

Automatic commit by the RecreateSKPs bot.

TBR=

Author: borenet@google.com

Review URL: https://codereview.chromium.org/560743002

9 years agoFix format of nanobench result
qiankun.miao [Wed, 10 Sep 2014 02:24:36 +0000 (19:24 -0700)]
Fix format of nanobench result

Column of samples is too wide. This makes config is not align with the
'config' title. Pad 'samples' tilte with some whitespaces to fix this
issue.

BUG=skia:
R=mtklein@google.com

Author: qiankun.miao@intel.com

Review URL: https://codereview.chromium.org/549153005

9 years agocorrect prev suppression
reed [Wed, 10 Sep 2014 02:22:37 +0000 (19:22 -0700)]
correct prev suppression

TBR=
NOTRY=True

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/543903005

9 years agosuppress multipicturedraw_pathclip_tiled_nvprmsaa4 after the conservative-rasterclip cl
reed [Wed, 10 Sep 2014 02:08:28 +0000 (19:08 -0700)]
suppress multipicturedraw_pathclip_tiled_nvprmsaa4 after the conservative-rasterclip cl

TBR=
NOTRY=True

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/555403002

9 years agoRevert of Revert of allow canvas to force conservative clips (for speed) (patchset...
reed [Wed, 10 Sep 2014 01:46:22 +0000 (18:46 -0700)]
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

9 years agoRebaselines for 6bc2c94de33 (fontmgr_iter).
bungeman [Wed, 10 Sep 2014 01:38:04 +0000 (21:38 -0400)]
Rebaselines for 6bc2c94de33 (fontmgr_iter).

Rebaselines for "Add font fallback support to SkFontMgr_fontconfig."

9 years agodisable webtry seccmp on non-linux build
humper [Tue, 9 Sep 2014 22:57:33 +0000 (15:57 -0700)]
disable webtry seccmp on non-linux build

BUG=skia:
R=jcgregorio@google.com

Author: humper@google.com

Review URL: https://codereview.chromium.org/555993002

9 years agosimple build script for webtry that re-generates the code template
humper [Tue, 9 Sep 2014 22:57:26 +0000 (15:57 -0700)]
simple build script for webtry that re-generates the code template
before compilation

BUG=skia:
R=jcgregorio@google.com

Author: humper@google.com

Review URL: https://codereview.chromium.org/552343003

9 years agorebase a couple oddballs
Mike Klein [Tue, 9 Sep 2014 21:52:40 +0000 (17:52 -0400)]
rebase a couple oddballs

BUG=skia:

Review URL: https://codereview.chromium.org/555193004

9 years agoRebase intel rhb gpu GMs.
Mike Klein [Tue, 9 Sep 2014 20:00:58 +0000 (16:00 -0400)]
Rebase intel rhb gpu GMs.

Looks like I accidentally re-enabled GPU mode in GM for Intel RHB.
Rebaseline it so it's green today before we turn it off tomorrow.

BUG=skia:

Review URL: https://codereview.chromium.org/552413002

9 years agoRevert of allow canvas to force conservative clips (for speed) (patchset #7 id:120001...
reed [Tue, 9 Sep 2014 19:51:10 +0000 (12:51 -0700)]
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

9 years agoAdd font fallback support to SkFontMgr_fontconfig.
bungeman [Tue, 9 Sep 2014 19:50:36 +0000 (12:50 -0700)]
Add font fallback support to SkFontMgr_fontconfig.

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

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/489733005

9 years agoWhen parsing arguments on Windows, check malloc() for failure.
senorblanco [Tue, 9 Sep 2014 19:37:16 +0000 (12:37 -0700)]
When parsing arguments on Windows, check malloc() for failure.

Note: this code is only executed by Skia utilities AFAIK, not by
external clients.

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

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/548343002

9 years agoUpdate the alias mapping for Noto Sans CJK.
jshin [Tue, 9 Sep 2014 19:30:57 +0000 (12:30 -0700)]
Update the alias mapping for Noto Sans CJK.

To make the family names 'future-proof', we decided to shorten
the name of Noto Sans CJK, which requires a change in the alias
table in Skia.

Chrome OS CL (actually updating the fonts) and Chrome CL (updating the
font preferences on CrOS) are going together with this CL.

BUG=412151
TEST=With the above two CLs in on Chrome OS, Noto Sans CJK {JP, SC} are
used when MS P Gothic / Simhei are asked for by a web page.

R=bungeman@google.com

Author: jshin@chromium.org

Review URL: https://codereview.chromium.org/554943002

9 years agoAllow SkCanvas to be initialized to force conservative rasterclips. This has the...
reed [Tue, 9 Sep 2014 19:19:30 +0000 (12:19 -0700)]
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

9 years agoMake -d x86 have the default GPU cache size.
mtklein [Tue, 9 Sep 2014 19:07:05 +0000 (12:07 -0700)]
Make -d x86 have the default GPU cache size.

We have no a priori reason to limit the cache for new devices.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/556863006

9 years agoOutset the stroke width when computing the bounds for drawing a stroked rect, or...
george [Tue, 9 Sep 2014 18:33:57 +0000 (11:33 -0700)]
Outset the stroke width when computing the bounds for drawing a stroked rect, or 1 if it's a hairline

Adds a testcase for stroke rect bug

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

Author: george@mozilla.com

Review URL: https://codereview.chromium.org/552743004

9 years agoAllow negative values in SkBlurImageFilter sigma.
senorblanco [Tue, 9 Sep 2014 16:15:04 +0000 (09:15 -0700)]
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

9 years agoBack to hashing source content, not .png.
mtklein [Tue, 9 Sep 2014 15:42:04 +0000 (08:42 -0700)]
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

9 years agoRevert of Use SkBitmapCache to optimize readPixels on a texture-backed bitmap (patchs...
fmalita [Tue, 9 Sep 2014 15:12:46 +0000 (08:12 -0700)]
Revert of Use SkBitmapCache to optimize readPixels on a texture-backed bitmap (patchset #6 id:100001 of https://codereview.chromium.org/533323002/)

Reason for revert:
Component inversions in Blink's printing/webgl-repeated-printing.html: https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/24033/layout-test-results/printing/webgl-repeated-printing-diff.txt

Reverting to unblock rolls.

Original issue's description:
> Use SkBitmapCache to optimize readPixels on a texture-backed bitmap
>
> BUG=skia:2786
>
> Committed: https://skia.googlesource.com/skia/+/95fd68e5ccd242a91e6dd827dd695f18661efbe6

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:2786

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/551523003

9 years agoAdding texture uploads without cache for YUV and ETC1
sugoi [Tue, 9 Sep 2014 15:12:34 +0000 (08:12 -0700)]
Adding texture uploads without cache for YUV and ETC1

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

Author: sugoi@chromium.org

Review URL: https://codereview.chromium.org/552843004

9 years agoUpdate DM JSON format.
mtklein [Tue, 9 Sep 2014 14:59:46 +0000 (07:59 -0700)]
Update DM JSON format.

Ex. dm --match patch -w bad --key arch x86 gpu nvidia model z620 --properties git_hash abcd build_number 20 ->

{
   "build_number" : "20",
   "git_hash" : "abcd",
   "key" : {
      "arch" : "x86",
      "gpu" : "nvidia",
      "model" : "z620"
   },
   "results" : [
      {
         "key" : {
            "config" : "565",
            "name" : "ninepatch-stretch"
         },
         "md5" : "f78cfafcbabaf815f3dfcf61fb59acc7",
         "options" : {
            "source_type" : "GM"
         }
      },
      {
         "key" : {
            "config" : "8888",
            "name" : "ninepatch-stretch"
         },
         "md5" : "3e8a42f35a1e76f00caa191e6310d789",
         "options" : {
            "source_type" : "GM"
         }
      },
...

This breaks -r, but that's okay.  Going to follow up this CL with one that removes that entirely.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/551873003

9 years agoRemove expectations / -r from DM entirely.
mtklein [Tue, 9 Sep 2014 14:36:57 +0000 (07:36 -0700)]
Remove expectations / -r from DM entirely.

It's getting tricky to coordinate changes to output for bots with -r,
and -r is not widely used.  The suggested alternative is to run skdiff.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/553583004

9 years agoSkRasterClip::quickReject doesn't need to check for emptiness as SkIRect::Intersect...
george [Tue, 9 Sep 2014 13:14:57 +0000 (06:14 -0700)]
SkRasterClip::quickReject doesn't need to check for emptiness as SkIRect::Intersect already does that for us

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

Author: george@mozilla.com

Review URL: https://codereview.chromium.org/554743007

9 years agoUpdate SKP version to 96
borenet [Tue, 9 Sep 2014 04:08:41 +0000 (21:08 -0700)]
Update SKP version to 96

Automatic commit by the RecreateSKPs bot.

TBR=

Author: borenet@google.com

Review URL: https://codereview.chromium.org/551263002

9 years agoRemove a linear search in SkPictureRecord::addTextBlob.
jbroman [Mon, 8 Sep 2014 20:24:33 +0000 (13:24 -0700)]
Remove a linear search in SkPictureRecord::addTextBlob.

It doesn't seem that harmful to have repeated text blobs in the array
if they occur within the same picture recording. And that does not seem
to be a common occurrence right now anyhow.

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

Author: jbroman@chromium.org

Review URL: https://codereview.chromium.org/550043003

9 years agoHash .pngs instead of SkBitmaps.
mtklein [Mon, 8 Sep 2014 19:42:23 +0000 (12:42 -0700)]
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

9 years agoMake GrEffectStage copy constructor work correctly with pending execution refs.
bsalomon [Mon, 8 Sep 2014 19:06:20 +0000 (12:06 -0700)]
Make GrEffectStage copy constructor work correctly with pending execution refs.

R=egdaniel@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/551083002

9 years agoFix two SkRecord-backed layer hoisting bugs
robertphillips [Mon, 8 Sep 2014 18:37:59 +0000 (11:37 -0700)]
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

9 years agoAdd --nameByHash for the bots, and refactor hashing a bit.
mtklein [Mon, 8 Sep 2014 18:33:48 +0000 (11:33 -0700)]
Add --nameByHash for the bots, and refactor hashing a bit.

No diff in dm.json output.

Here's what we get when --nameByHash is on:

mtklein@mtklein ~/skia (dm)> ls bad4/
0077fefedcee39feae9d12751853758b.png  431921de1607b4e1ae6864cc684d9b8e.png  8a3e17eba9302498700a703bb286d1ef.png  c6448cb266f5e0b8d02b512ad484a9ad.png
01b0dcd515e846ea3b7f3b4c68120943.png  4372eb0fce0b0bcf5a582c502f90ecef.png  8a6acdd96cf6915fa01a9cea6d6291b0.png  c6db4e2c9860b900130af429373eafaa.png
02974ab0efa7aa325b3bf22515b33899.png  43bddc2e255a3501ce2728544b1d409d.png  8aa8763d11afd397c2768e54d5599181.png  c716a9a53513a16e0572c67863e3be08.png
02b7b9e5e95e69f89b6cec9c4539d972.png  43cf7adda66b3719e4abd19e92dda55e.png  8ade6bb4c9e2244e0dbd9436cf6e2132.png  c854bb6dd105644a71d0219025409039.png
02d29dbfd29260f9318fcd6177c6ba7b.png  4423958139a2b64185583dacb7379b13.png  8b039171593685112a9454879f40a965.png  c863ac2394e519690c57e1392b14b19f.png
...

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/550283002

9 years agoRemove extra proctected in GrRODrawState.h
egdaniel [Mon, 8 Sep 2014 17:48:37 +0000 (10:48 -0700)]
Remove extra proctected in GrRODrawState.h

BUG=skia:
R=bsalomon@google.com

Author: egdaniel@google.com

Review URL: https://codereview.chromium.org/550243002

9 years agoRemove debug-only ref of GrEffectStage
bsalomon [Mon, 8 Sep 2014 17:45:58 +0000 (10:45 -0700)]
Remove debug-only ref of GrEffectStage

BUG=skia:2889
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/553973002

9 years agofail when coincidence is too far apart
caryclark [Mon, 8 Sep 2014 17:25:38 +0000 (10:25 -0700)]
fail when coincidence is too far apart

TBR=
BUG=410552

Author: caryclark@google.com

Review URL: https://codereview.chromium.org/556433002

9 years agoRevert of Fix two SkRecord-backed layer hoisting bugs (patchset #1 id:1 of https...
robertphillips [Mon, 8 Sep 2014 17:10:51 +0000 (10:10 -0700)]
Revert of Fix two SkRecord-backed layer hoisting bugs (patchset #1 id:1 of https://codereview.chromium.org/551843002/)

Reason for revert:
turning bots red

Original issue's description:
> 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
TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/553983003

9 years agoFix two SkRecord-backed layer hoisting bugs
robertphillips [Mon, 8 Sep 2014 16:53:58 +0000 (09:53 -0700)]
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).

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/551843002

9 years agoLet .skps have Expectations (i.e. work with -r) too.
mtklein [Mon, 8 Sep 2014 16:12:28 +0000 (09:12 -0700)]
Let .skps have Expectations (i.e. work with -r) too.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/549183002

9 years agoTurn on the save-layer optimization.
mtklein [Mon, 8 Sep 2014 15:41:37 +0000 (08:41 -0700)]
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

9 years agoUse SkBitmapCache to optimize readPixels on a texture-backed bitmap
piotaixr [Mon, 8 Sep 2014 15:07:47 +0000 (08:07 -0700)]
Use SkBitmapCache to optimize readPixels on a texture-backed bitmap

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

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/533323002

9 years agoStart to rework DM JSON handling.
mtklein [Mon, 8 Sep 2014 15:05:18 +0000 (08:05 -0700)]
Start to rework DM JSON handling.

DM's striking off into its own JSON world.  This gets strawman implementations
in place for writing and reading a JSON file mapping test name to hashes.

For what it's worth, I basically want to change _all_ these pieces,
  - MD5 is slow and we can replace it with something faster,
  - JSON schema needs room to grow more data,
  - it'd be nice to hash once instead of twice when reading and writing,
  - this code wants lots of refactoring,
but this gives us a starting platform to work on these bits at our leisure.

E.x. file for now:

mtklein@mtklein ~/skia (dm)> cat good/dm.json
{
   "3x3bitmaprect_565" : "fc70d985fbfbe70e3a3c9dc626d4f5bc",
   "3x3bitmaprect_8888" : "df1591dde35907399734ea19feb76663",
   "3x3bitmaprect_gpu" : "df1591dde35907399734ea19feb76663",
   "aaclip_565" : "1862798689b838a7ab0dc0652b9ace3a",
   "aaclip_8888" : "47bb314329f0ce243f1d83fd583decb7",
   "aaclip_gpu" : "75f72412d0ef4815770202d297246e7d",
...

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/546873002

9 years agoTurn on all pixel-perfect SkRecord optimizations.
mtklein [Mon, 8 Sep 2014 14:31:18 +0000 (07:31 -0700)]
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

9 years agoUpdate SKP version to 95
borenet [Mon, 8 Sep 2014 03:52:36 +0000 (20:52 -0700)]
Update SKP version to 95

Automatic commit by the RecreateSKPs bot.

TBR=

Author: borenet@google.com

Review URL: https://codereview.chromium.org/552663002

9 years agoUpdate SKP version to 94
borenet [Sun, 7 Sep 2014 03:40:51 +0000 (20:40 -0700)]
Update SKP version to 94

Automatic commit by the RecreateSKPs bot.

TBR=

Author: borenet@google.com

Review URL: https://codereview.chromium.org/541173005