Commit Graph

17970 Commits

Author SHA1 Message Date
joshualitt
5b4f05f709 Move GrProcessorDataManager to GrMemoryPool
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1225363002
2015-07-10 07:26:21 -07:00
joel.liang
9764c40cd3 Workaround for blacklist KHR_blend_equation_advanced on ARM GPU
ARM driver will check the fragment shader compatiblity for KHR_blend_equation_advanced even if blending is disabled.
Workaround: Set blending equation to any basic equation when we disable blending.
https://code.google.com/p/skia/issues/detail?id=3943

BUG=skia:3943

Review URL: https://codereview.chromium.org/1216963004
2015-07-09 19:46:18 -07:00
fmalita
ea561bf055 Fix SkImage::asLegacyBitmap() rowBytes assert
When reusing the pixel ref, we need to observe its rowBytes.

R=reed@google.com

Review URL: https://codereview.chromium.org/1227413002
2015-07-09 17:10:31 -07:00
mtklein
694307c9f1 Let's not leak this SkData.
BUG=skia:

Review URL: https://codereview.chromium.org/1231903006
2015-07-09 15:41:11 -07:00
reed
d7c05bfd7c remove getter for imagegenerator factory, update test
BUG=skia:

Review URL: https://codereview.chromium.org/1223413002
2015-07-09 14:08:49 -07:00
herb
ac09471140 Create a template AutoTAcquire, and specialize an SkMutex version.
Add copyright notice.

BUG=skia:

Review URL: https://codereview.chromium.org/1230583008
2015-07-09 13:44:32 -07:00
joshualitt
7b670db2b4 Remove setFromPaint from GrPipelineBuilder
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1227153003
2015-07-09 13:25:02 -07:00
joshualitt
4f6dc521f5 Trivial cleanup of copying GrPipelineBuilder
TBR=robertphillips@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1229983003
2015-07-09 12:17:44 -07:00
reed
1c84634454 add runtime option to provide data->imagegenerator factory
BUG=skia:

Review URL: https://codereview.chromium.org/1229933003
2015-07-09 11:47:36 -07:00
herb
3547505278 Add RAII for other types of locks. Change SkGlyphCache_Globals to
use a SkSpinlock instead of SkMutex. This results in significant
performance increase for mpd in nanobench.

BUG=skia:

Review URL: https://codereview.chromium.org/1210143004
2015-07-09 11:37:35 -07:00
joshualitt
9df4659523 Remove init function from GrTextContext.h
BUG=skia:

Review URL: https://codereview.chromium.org/1231923002
2015-07-09 10:55:28 -07:00
mtklein
828877d726 Outline SkSpinlock::acquire().
The proportion of time spent doing useful work is well over 99% in acquire(),
so outlining it doesn't hurt speed at all, and makes it much easier to pick out
on a profile.

It'd be about 50/50 work/overhead if we outlined the extremely-cheap release().
I also tried outlining some SkRefCnt methods with similar mixed results.

BUG=skia:

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

Review URL: https://codereview.chromium.org/1212253013
2015-07-09 10:51:36 -07:00
herb
af4edf9ccc Change to use mean and to use stderr.
BUG=skia:

Review URL: https://codereview.chromium.org/1228783003
2015-07-09 10:50:24 -07:00
joshualitt
5f10b5c1b5 More threading of GrProcessorDataManager
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1230813003
2015-07-09 10:24:36 -07:00
mtklein
cc29d26f57 Have nanobench pay attention to --threads.
TBR=

BUG=skia:

Review URL: https://codereview.chromium.org/1229953002
2015-07-09 10:04:56 -07:00
scroggo
5315fd4761 Remove SkImageGenerator pieces only for SkCodec.
Follow up to the split between SkImageGenerator and SkCodec. Now that
SkCodec does not inherit from SkImageGenerator, SkImageGenerator no
longer needs Options or Result, which were added for SkCodec. Remove
them, but keep them behind a flag, since Chromium has its own
subclasses of SkImageGenerator which assume the old signature for
onGetPixels.

Review URL: https://codereview.chromium.org/1226023003
2015-07-09 09:08:00 -07:00
jvanverth
d17a32966a Add normal map sample
This adds an example of an SkShader that does normal
mapping. It has a single directional light and an
ambient light.

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

Review URL: https://codereview.chromium.org/1212813009
2015-07-09 09:04:16 -07:00
msarett
ef46468063 Temporarily suppress valgrind errors in tip of tree libjpeg-turbo
BUG=skia:4030

Review URL: https://codereview.chromium.org/1231613004
2015-07-09 08:23:50 -07:00
scroggo
eb602a5c94 SkCodec no longer inherits from SkImageGenerator.
SkImageGenerator makes some assumptions that are not necessarily valid
for SkCodec. For example, SkCodec does not assume that it can always be
rewound.

We also have an ongoing question of what an SkCodec should report as
its default settings (i.e. the return from getInfo). It makes sense for
an SkCodec to report that its pixels are unpremultiplied, if that is
the case for the underlying data, but if a client of SkImageGenerator
uses the default settings (as many do), they will receive
unpremultiplied pixels which cannot (currently) be drawn with Skia. We
may ultimately decide to revisit SkCodec reporting an SkImageInfo, but
I have left it unchanged for now.

Import features of SkImageGenerator used by SkCodec into SkCodec.

I have left SkImageGenerator unchanged for now, but it no longer needs
Result or Options. This will require changes to Chromium.

Manually handle the lifetime of fScanlineDecoder, so SkScanlineDecoder.h
can include SkCodec.h (where Result is), and SkCodec.h does not need
to include it (to delete fScanlineDecoder).

In many places, make the following simple changes:
- Now include SkScanlineDecoder.h, which is no longer included by
  SkCodec.h
- Use the enums in SkCodec, rather than SkImageGenerator
- Stop including SkImageGenerator.h where no longer needed

Review URL: https://codereview.chromium.org/1220733013
2015-07-09 08:16:03 -07:00
msarett
72394ef87c Do not try to compile x86 and x86_64 .asm files on Android
This is currently only works on Linux hosts because we have checked
in a binary and does not work on Mac hosts.  We are disabling until
we find a suitable solution.

BUG=skia:4028

Review URL: https://codereview.chromium.org/1228823006
2015-07-09 07:55:01 -07:00
joshualitt
2cdec31c29 YUV to RGB Texture threading GrProcessorDataManager
BUG=skia:

Review URL: https://codereview.chromium.org/1230803002
2015-07-09 07:31:32 -07:00
halcanary
8d3f7bde94 doc: more changes
NOTRY=true
DOCS_PREVIEW= https://skia.org/user/api/skcanvas?cl=1228063002
DOCS_PREVIEW= https://skia.org/user/tips?cl=1228063002
TBR=

Review URL: https://codereview.chromium.org/1228063002
2015-07-09 06:58:06 -07:00
joshualitt
9cc1775e72 rename GrShaderDataManager -> GrProcessorDataManager
BUG=skia:

Review URL: https://codereview.chromium.org/1228683002
2015-07-09 06:28:14 -07:00
robertphillips
426388eeb7 Revert of Add normal map sample (patchset #6 id:100001 of https://codereview.chromium.org/1212813009/)
Reason for revert:
Compilation failures:

../../../../../samplecode/SampleLighting.cpp:13:18: fatal error: SkGr.h: No such file or directory

Original issue's description:
> Add normal map sample
>
> This adds an example of an SkShader that does normal
> mapping. It has a single directional light and an
> ambient light.
>
> Committed: https://skia.googlesource.com/skia/+/8e0da72ba890de395c9946ec6639c9e1e7b16027

TBR=reed@google.com,bsalomon@google.com,jvanverth@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1230603002
2015-07-08 14:46:12 -07:00
joshualitt
0067ff5e0f fix up test create functions
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1213623022
2015-07-08 14:26:19 -07:00
jvanverth
8e0da72ba8 Add normal map sample
This adds an example of an SkShader that does normal
mapping. It has a single directional light and an
ambient light.

Review URL: https://codereview.chromium.org/1212813009
2015-07-08 14:21:47 -07:00
halcanary
0007bde420 SkAdvancedTypefaceMetrics zeroing constructor
Review URL: https://codereview.chromium.org/1221903004
2015-07-08 13:58:45 -07:00
dcheng
3ba043f460 Remove another assertion that a reference is non-null.
This tickles a warning in Clang:
reference cannot be bound to dereferenced null pointer in well-defined
C++ code; pointer may be assumed to always convert to true
[-Wundefined-bool-conversion]

BUG=none

Review URL: https://codereview.chromium.org/1225053003
2015-07-08 13:25:23 -07:00
ethannicholas
4f3ad2948c disabled GrAALinearizingConvexRenderer for now
BUG=505579

Review URL: https://codereview.chromium.org/1219653004
2015-07-08 13:19:51 -07:00
joshualitt
81793410a8 add ability to get FBO ID to Surface
BUG=skia:

Review URL: https://codereview.chromium.org/1220733007
2015-07-08 12:54:04 -07:00
reed
3c06511e91 Add image->bitmap
BUG=skia:

patch from issue 1212163012 at patchset 1 (http://crrev.com/1212163012#ps1)

Review URL: https://codereview.chromium.org/1208993017
2015-07-08 12:46:23 -07:00
halcanary
37fffc6e8f doc: embed fiddle
NOTRY=true
DOCS_PREVIEW= https://skia.org/user/api/skcanvas?cl=1149633009
DOCS_PREVIEW= https://skia.org/user/api/skpaint?cl=1149633009

Review URL: https://codereview.chromium.org/1149633009
2015-07-08 11:34:36 -07:00
fmalita
21217abe0d Remove SkImage::NewFromBitmap encoded data helper
Attempting to instantiate image decoders at this stage introduces
embedder dependencies.

Instead, we can just let callers set up any needed generators on the
bitmap.

R=reed@google.com

Review URL: https://codereview.chromium.org/1218663012
2015-07-08 11:34:20 -07:00
bsalomon
7765a477ee Makes GrPipelineInfo a class with query functions used by GrBatch subclasses.
Committed: https://skia.googlesource.com/skia/+/f5179a4c490bc787190321bd8ffdb0e6a4efa9ac

Review URL: https://codereview.chromium.org/1213383005
2015-07-08 11:26:37 -07:00
scroggo
c1d1dd738e Revert of Use the upstream version of libwebp, v0.4.3. (patchset #6 id:70001 of https://codereview.chromium.org/1178013008/)
Reason for revert:
Breaking the build e.g. http://build.chromium.org/p/client.skia/builders/Perf-Mac10.8-Clang-MacMini4.1-GPU-GeForce320M-x86_64-Release/builds/1082/steps/build%20nanobench/logs/stdio

../../../third_party/externals/libwebp/src/utils/./endian_inl.h:51:10: error: use of unknown builtin '__builtin_bswap16' [-Wimplicit-function-declaration]
  return __builtin_bswap16(x);
         ^
1 error generated.

Original issue's description:
> Use the upstream version of libwebp, v0.4.3.
>
> DEPS:
> Update to pull v0.4.3 of libwebp from upstream
>
> gyp/libwebp.gyp:
> Add new files, as referenced by the gyp file used by Chromium.
>
> resource/tests:
> Add regression tests for particular images.
>
> BUG=skia:3442
> BUG=skia:3315
> BUG=skia:3429
>
> Committed: https://skia.googlesource.com/skia/+/3aa0fb4d80c76b559ff4b82d5e569993aea06da1

TBR=djsollen@google.com,jzern@chromium.org,msarett@google.com,emmaleer@google.com,scroggo@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3442

Review URL: https://codereview.chromium.org/1223583004
2015-07-08 10:57:22 -07:00
halcanary
5f0b0ad5d9 doc: add instructions to capture a .skp from chromium
NOTRY=true

DOCS_PREVIEW= https://skia.org/user/tips?cl=1220783005

Review URL: https://codereview.chromium.org/1220783005
2015-07-08 10:56:01 -07:00
djsollen
8de81806db Add gradle wrappers for Android app builds
These wrappers are approxiately 56K in size and are the recommened
way to use Gradle.  It also ensures that developers wanting to
build the app don't need install an additional dependency.

Review URL: https://codereview.chromium.org/1227723002
2015-07-08 10:50:42 -07:00
scroggo
3aa0fb4d80 Use the upstream version of libwebp, v0.4.3.
DEPS:
Update to pull v0.4.3 of libwebp from upstream

gyp/libwebp.gyp:
Add new files, as referenced by the gyp file used by Chromium.

resource/tests:
Add regression tests for particular images.

BUG=skia:3442
BUG=skia:3315
BUG=skia:3429

Review URL: https://codereview.chromium.org/1178013008
2015-07-08 10:48:40 -07:00
bsalomon
d07a2793ba Revert of Rework GrPipelineInfo (patchset #7 id:120001 of https://codereview.chromium.org/1213383005/)
Reason for revert:
breaking stuff!

Original issue's description:
> Makes GrPipelineInfo a class with query functions used by GrBatch subclasses.
>
> Committed: https://skia.googlesource.com/skia/+/f5179a4c490bc787190321bd8ffdb0e6a4efa9ac

TBR=joshualitt@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1213013003
2015-07-08 10:20:21 -07:00
mtklein
60c0475575 Add tools/flatten to flatten nested pictures in .skps.
Tested by running on skps/sp_desk_nytimes.skp.
The output .skp had no nested draw picture calls, and the files were both 9.3M.

BUG=skia:

Review URL: https://codereview.chromium.org/1221303020
2015-07-08 10:06:01 -07:00
joshualitt
b2456053c7 more threading of GrShaderDataManager
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1215643006
2015-07-08 09:36:59 -07:00
joshualitt
85ff25e8d9 Thread GrShaderDataManager through Image filters
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1229613002
2015-07-08 09:10:03 -07:00
mtklein
711a245dda DM runs more than 100k tests now.
BUG=skia:

Review URL: https://codereview.chromium.org/1217493006
2015-07-08 08:49:20 -07:00
mtklein
eedc3342db Fix leak in PictureTest.cpp
TBR=schenney@chromium.org

BUG=skia:

Review URL: https://codereview.chromium.org/1210053008
2015-07-08 08:26:39 -07:00
joshualitt
2cff176fa2 More threading of GrShaderDataManager
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1213613016
2015-07-08 07:58:18 -07:00
bsalomon
f5179a4c49 Makes GrPipelineInfo a class with query functions used by GrBatch subclasses.
Review URL: https://codereview.chromium.org/1213383005
2015-07-08 07:55:59 -07:00
bsalomon
cc97ece058 Add SK_API to GrSurface
TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/1209043012
2015-07-08 07:53:10 -07:00
mtklein
38408460ad DM: swizzle BGRA to RGBA before calculating pixel MD5.
We name our .pngs by pixel hashes for gold.  For 8888 images, we're hashing
SkPMColors, which have platform-dependent order: BGRA on Linux and Windows,
RGBA otherwise. This means we can end up with pixel-identical pngs with
different hashes, which is confusing.

This CL standardizes on RGBA for 8888 configs, arbitrarily chosen so that
Android ends up a no-op.  Long-term, this should eliminate most of the
0-pixel-diff problems we see on gold.skia.org.  There are other ways to end up
with the same .png from different SkBitmaps (think, red 565 square vs. red 8888
square) but they're rather less common / likely.

This will temporarily create a giant 0-pixel-diff problem on gold.skia.org.
Any Linux or Windows images which are not already pixel-identical to a Mac or
Android image should show up as untriaged hashes that are pixel-identical to
their version just before landing (we're only changing the hash, not the .png).
This means anything vaguely platform dependent (fonts, GPUs) will probably show
up as needing a triage but with a zero diff from a previous image.

If this goes well, we might do the same for 565.  Just want to leave them out
for now to cut down on the triaging I need to do in one go.

BUG=skia:

Review URL: https://codereview.chromium.org/1226933005
2015-07-08 07:25:27 -07:00
joshualitt
8ca93e7c73 Initial CL to create dummy GrShaderDataManager and thread it through
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1225673007
2015-07-08 06:51:43 -07:00
dcheng
2f19b551ac Remove &glyph from SkASSERT.
This tickles a warning in Clang:
reference cannot be bound to dereferenced null pointer in well-defined
C++ code; pointer may be assumed to always convert to true
[-Wundefined-bool-conversion]

BUG=none

Review URL: https://codereview.chromium.org/1220113003
2015-07-07 19:35:53 -07:00