Commit Graph

18031 Commits

Author SHA1 Message Date
ericrk
91abe10af4 Bilinear optimization for 1D convolution.
Splits GrGLConvolutionEffect into GrGLBilerpConvolutionEffect and
GrGLBoundedConvolutionEffect. When doing a non-bounded convolution we now
always use the GrGLBilerpConvolutionEffect which uses bilinear filtering to
perform half as many samples in the texture.

BUG=skia:3986

Review URL: https://codereview.chromium.org/1216623003
2015-07-10 15:05:13 -07:00
joshualitt
3989205322 remove some unused stuff
BUG=skia:

Review URL: https://codereview.chromium.org/1231163002
2015-07-10 14:14:03 -07:00
reed
d0f4173fb0 add option to use global mutex-lock in mac-scalercontext
BUG=413332

Review URL: https://codereview.chromium.org/1220873009
2015-07-10 12:08:38 -07:00
scroggo
9b2cdbf481 Allow creating multiple scanline decoders.
Make getScanlineDecoder return a new object each time, which is
owned by the caller, and independent from any existing scanline
decoders and the SkCodec itself.

Since the SkCodec already contains the entire state machine, and it
is used by the scanline decoders, simply create a new SkCodec which
is now owned by the scanline decoder.

Move code that cleans up after using a scanline decoder into its
destructor

One side effect is that creating the first scanline decoder requires
a duplication of the stream and re-reading the header. (With some
more complexity/changes, we could pass the state machine to the
scanline decoder and make the SkCodec recreate its own state machine
instead.) The typical client of the scanline decoder (region decoder)
uses an SkMemoryStream, so the duplication is cheap, although we
should consider the extra time to reread the header/recreate the state
machine. (If/when we use the scanline decoder for other purposes,
where the stream may not be cheaply duplicated, we should consider
passing the state machine.)

One (intended) result of this change is that a client can create a
new scanline decoder in a new thread, and decode different pieces of
the image simultaneously.

In SkPngCodec::decodePalette, use fBitDepth rather than a parameter.

Review URL: https://codereview.chromium.org/1230033004
2015-07-10 12:07:02 -07:00
joshualitt
f9c5db26b4 Trivial cleanup
TBR=robertphillips@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1229913007
2015-07-10 11:31:01 -07:00
scroggo
33d35263bf Move android_gdb_tmp into out/
This way it will be ignored.

Review URL: https://codereview.chromium.org/1230773003
2015-07-10 11:05:10 -07:00
msarett
718e41dcb0 Fix msvs builds
BUG=skia:

Review URL: https://codereview.chromium.org/1229303002
2015-07-10 10:59:47 -07:00
scroggo
139491fbaa 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

Review URL: https://codereview.chromium.org/1178013008
2015-07-10 09:32:09 -07:00
joshualitt
416e14f517 fix for valgrind issue
BUG=skia:

Review URL: https://codereview.chromium.org/1227933003
2015-07-10 09:05:57 -07:00
dongseong.hwang
5ce8b438da Fix componene debug build failure in chromium
The error log is as follows:
../../third_party/skia/include/core/SkSpinlock.h:24: error: undefined reference to 'SkPODSpinlock::contendedAcquire()'
collect2: error: ld returned 1 exit status

[mtklein added below here]
Despite the presence in include/ and the added SK_API, this file is not part of Skia's public API... it's just used by files which are.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1229003004
2015-07-10 08:32:23 -07:00
emmaleer
21cea726e7 Changing name of has_transpareny_in_palette to has_transparency_in_tRNS
This function checks for transparency info in the tRNS chunk
Other images besides paletted images can have tRNS chunks,
including Gray8 and RGB

has_transparency_in_tRNS is a better name for the function

BUG=skia:

Review URL: https://codereview.chromium.org/1224453002
2015-07-10 07:48:03 -07:00
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