Commit Graph

18442 Commits

Author SHA1 Message Date
bsalomon
cb02b38b2c Check for xfer barriers in GrBatch, auto-issue barriers in GrGpu
Review URL: https://codereview.chromium.org/1287973003
2015-08-12 11:14:50 -07:00
mtklein
6028a84765 Normalize SkXfermode_opts.h argument order as d,s[,aa].
At head they're s,d[,aa] in SkXfermode_opts.h but Sk4px::Map* expect d,s[,aa]
so we ended up having to write weird little lambda shims to match impedance.

There's no reason for these to disagree, and d,s[,aa] is the One True Order
(because no matter what you're doing in graphics, there's always a dst).

Should be no perf or image diff, though I'm suspicious it might help MSVC code generation.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1289903002
2015-08-12 10:52:25 -07:00
mtklein
b07bee3121 Refactor to put SkXfermode_opts inside SK_OPTS_NS.
Without this refactor I was getting warnings previously about having code
inside namespace SK_OPTS_NS (e.g. namespace sse2, namespace neon) referring to
code inside an anonymous namespace (Sk4px, SkPMFloat, Sk4f, etc) [1].

That low-level code was in an anonymous namespace to allow multiple independent
copies of its methods to be instantiated without the linker getting confused /
offended about violating the One Definition Rule.  This was only happening in
Debug mode where the methods were not being inlined.

To fix this all, I've force-inlined the methods of the low-level code and
removed the anonymous namespace.

BUG=skia:4117

[1] Here is what those errors looked like:

In file included from ../../../../src/core/SkOpts.cpp:18:0:
../../../../src/opts/SkXfermode_opts.h:193:7: error: 'portable::Sk4pxXfermode' has a field 'portable::Sk4pxXfermode::fProc4' whose type uses the anonymous namespace [-Werror]
 class Sk4pxXfermode : public SkProcCoeffXfermode {
       ^
../../../../src/opts/SkXfermode_opts.h:193:7: error: 'portable::Sk4pxXfermode' has a field 'portable::Sk4pxXfermode::fAAProc4' whose type uses the anonymous namespace [-Werror]
../../../../src/opts/SkXfermode_opts.h:235:7: error: 'portable::SkPMFloatXfermode' has a field 'portable::SkPMFloatXfermode::fProcF' whose type uses the anonymous namespace [-Werror]
 class SkPMFloatXfermode : public SkProcCoeffXfermode {
       ^
cc1plus: all warnings being treated as errors

Review URL: https://codereview.chromium.org/1286093004
2015-08-12 10:23:37 -07:00
wangyix
58d890bd45 All child GrFragmentProcs' transforms and textures will be stored in the root GrFragmentProc in preorder
Changed childProcessor(i) to return const referencd

Fixed rootProc/parentProc offset issues; renamed a few things.

added nonempty check to gatherTransforms to avoid segfault

removed recursive append_gr_coord_transforms() from GrGLProgramBuilder

BUILDS! Changed num*includeProc() calls to num() calls

added gatherCoordTransforms(). added coordTransforms() for root proc only

Modified GrFragmentProcessor to append child proc transforms and textures to root proc's arrays.

BUG=skia:4182

Review URL: https://codereview.chromium.org/1275853005
2015-08-12 09:40:47 -07:00
halcanary
cc34c41326 Revert of SkPDF: Move SkFlate into src/pdf (part 1/3) (patchset #1 id:1 of https://codereview.chromium.org/1285913002/ )
Reason for revert:
broke gn ("Duplicate object file")

Original issue's description:
> SkPDF:  Move SkFlate into src/pdf (part 1/3)
>
> Next, we change Chromium build files, then we do the actual move.
>
> Committed: https://skia.googlesource.com/skia/+/e14c1fe04fc72ec9bcf55820b5c65a71d7d0a764

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

Review URL: https://codereview.chromium.org/1289863002
2015-08-12 08:53:04 -07:00
scroggo
d1bc5746ba Update CodexTest to test valid_alpha.
Add a static function to CodexTest, which consolidates decoding,
comparing to an expected SkCodec::Result, and optionally comparing to a
digest.

Test decoding non-opaque to opaque (fails) and premul to unpremul/vice
versa (succeeds).

BUG=skia:3475

Review URL: https://codereview.chromium.org/1277253003
2015-08-12 08:31:44 -07:00
jvanverth
5a4d23508c Revise DrawAtlasBatch to get rid of one copy when generating the batch.
This doesn't appear to have much affect on perf in SampleApp, but
it should avoid some copies and replaces a couple of STArrays
with one that just does a memcpy in the copy constructor.

Review URL: https://codereview.chromium.org/1279343004
2015-08-12 08:15:31 -07:00
bsalomon
69a9689ace Remove trace marker support from GrBufferedDrawTarget
Review URL: https://codereview.chromium.org/1284983002
2015-08-12 08:11:22 -07:00
msarett
d0375bc460 Fix bmp RLE "bug"
Chromium's test suite contains an RLE image that reports a certain
file size in the header, but then contains additional encoded data.
Our bmp decoder would only decode half of the image, before stopping.

With this fix, we check for additional data before returning
kIncompleteInput.

If this lands, I will upload the test image to the bots.

Also adding an invalid image test to CodexTest.

BUG=skia:

Review URL: https://codereview.chromium.org/1273853004
2015-08-12 08:08:56 -07:00
halcanary
e14c1fe04f SkPDF: Move SkFlate into src/pdf (part 1/3)
Next, we change Chromium build files, then we do the actual move.

Review URL: https://codereview.chromium.org/1285913002
2015-08-12 07:39:33 -07:00
halcanary
65cc3e4644 C API: add radial, sweep, and two-point conical gradient shaders
Review URL: https://codereview.chromium.org/1263773006
2015-08-12 07:37:34 -07:00
scroggo
b427db1d45 Consolidate SkCodec functions for handling rewind
Previously, many of our codec implementations followed the same
pattern (often in a function named handleRewind):

switch (this->rewindIfNeeded()) {
  case CouldNotRewind:
    return CouldNotRewind;
  case NoRewindNecessary:
    // keep going
    break;
  case Rewound:
     <re-read header etc>
    break;
}

In this CL, remove the enum, and put the piece that happens in the
Rewound case into a virtual function, onRewind. rewindIfNeeded now
contains the common pieces from various functions named handleRewind.

In SkBmpCodec, add a function that returns whether the BMP is in ICO,
so it can have a common implementation for onRewind.

BUG=skia:3257

Review URL: https://codereview.chromium.org/1288483002
2015-08-12 07:24:13 -07:00
egdaniel
4b5472bdb0 Add ability to pass in an optional path to additional unit tests to run.
BUG=skia:

Review URL: https://codereview.chromium.org/1280133004
2015-08-12 06:51:08 -07:00
joshualitt
37eb184e26 Move AAFillRect into CPP for templatization
BUG=skia:

Review URL: https://codereview.chromium.org/1278043003
2015-08-12 06:36:57 -07:00
reed
9cdcabefa3 Revert[3] "move some public headers into private"
This reverts commit 9d20ee57d7.

BUG=skia:
TBR=

failures here: https://codereview.chromium.org/1286103004

Review URL: https://codereview.chromium.org/1290733002
2015-08-12 05:33:12 -07:00
reed
9d20ee57d7 Revert[2] "move some public headers into private"
This reverts commit 4cf9e7e147.

BUG=skia:
TBR=
NOTRY=True

Review URL: https://codereview.chromium.org/1284173002
2015-08-12 04:42:08 -07:00
bsalomon
a387a11f9e Make GrBatch carry its own GrPipeline
Review URL: https://codereview.chromium.org/1278643006
2015-08-11 14:47:42 -07:00
msarett
3bff4749e4 Hopefully fix ios bots
BUG=skia:

Review URL: https://codereview.chromium.org/1286833002
2015-08-11 14:44:02 -07:00
halcanary
2ccdb636e8 SkPDF: clean up overuse of SK_SUPPORT_PDF
When possible use run-time checks (via SkDocument::CreatePDF)
When PDF is disabled, do not compile tests/PDF*.cpp

Review URL: https://codereview.chromium.org/1278403006
2015-08-11 13:35:12 -07:00
msarett
fcaaadee71 Switching Skia to chromium's libjpeg-turbo
Compile SkJpegCodec and SkImageDecoder_libjpeg with
chromium's libjpeg-turbo.  SkImageDecoder_libjpeg still uses
libjpeg on Android and the Android framework.  SkJpegCodec is
still not compiled on the Android framework.

BUG=skia:

Review URL: https://codereview.chromium.org/1275773004
2015-08-11 13:32:54 -07:00
reed
7cdfa8a3f4 decrement lockcount if we failed to get pixels
BUG=519581

Review URL: https://codereview.chromium.org/1284953002
2015-08-11 12:23:45 -07:00
jvanverth
4d0d81aec2 Add high resolution WallTimer to SampleApp
Gives better than 1 ms results when timing framerate.

Review URL: https://codereview.chromium.org/1288473002
2015-08-11 11:07:07 -07:00
halcanary
8ee06f21a2 SkPDF: allow PDF module to be disabled in DM and SampleApp
To disable PDF:

    GYP_DEFINES='skia_pdf=0' bin/sync-and-gyp
    ninja -C out/Debug dm SampleApp

When disabled, SkDocument::CreatePDF() always returns NULL.

Review URL: https://codereview.chromium.org/1279123007
2015-08-11 10:30:12 -07:00
reed
4cf9e7e147 Revert "move some public headers into private"
This reverts commit eedf0fb204.

BUG=skia:
TBR=
NOTRY=True

Review URL: https://codereview.chromium.org/1270313005
2015-08-11 08:39:18 -07:00
reed
eedf0fb204 move some public headers into private
BUG=skia:

Review URL: https://codereview.chromium.org/1289483002
2015-08-11 07:15:00 -07:00
hcm
95d79132cf Move Perf documentation to the testing section
BUG=skia:
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1280533003

Review URL: https://codereview.chromium.org/1280533003
2015-08-11 07:00:01 -07:00
bsalomon
5ac42ea807 Make initBatchTracker private, move towards pipeline on batch
Review URL: https://codereview.chromium.org/1282893002
2015-08-10 13:03:51 -07:00
mtklein
4977983510 Sk4px blit mask.
Local SKP nanobenching ranges SSE between 1.05x and 0.87x, much more heavily weighted toward <1.0x ratios (speedups).
I profiled the top five regressions (1.05x-1.01x) and they look like noise.  Will follow up after broad bot results.

NEON looks similar but less extreme than SSE changes, ranging between 1.02x and 0.95x, again mostly speedups in 0.99x-0.97x range.

The old code trifurcated into black, opaque-but-not-black, and general versions as a function of the constant src color.  I did not see a significant difference between general and opaque-but-not-black, and I don't think a black version would be faster using SIMD.  So we have here just one version of the code, the general version.

Somewhat fantastically, I see no pixel diffs on GMs or SKPs.

I will be following up with more CLs for the other procs called by SkBlitMask.
BUG=skia:

Review URL: https://codereview.chromium.org/1278253003
2015-08-10 12:58:17 -07:00
bsalomon
c699873ac7 Remove GrPipelineOptimizations member from GrPipeline
Review URL: https://codereview.chromium.org/1275003004
2015-08-10 12:01:15 -07:00
joshualitt
b7ee1bf017 trivial CL to add drawBatch to GrDrawContext
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1282883002
2015-08-10 11:59:03 -07:00
joshualitt
14205b114a Expand functionality of GrRectBatchFactory with AARects
BUG=skia:

Review URL: https://codereview.chromium.org/1279303002
2015-08-10 11:40:56 -07:00
egdaniel
fb69bb3a5e Fix to call SkDelete_array instead of SkDelete to fix ASAN error.
TBR=mtklein@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1282333002
2015-08-10 11:39:10 -07:00
egdaniel
2a5ca89ea1 Revert of [TextBlob] Fall back to TightRunBounds when the font bounds are empty (patchset #1 id:1 of https://codereview.chromium.org/1284693002/ )
Reason for revert:
Breaking DEPS roll on Assert in SkTextBlobBuilder::TightRunBounds.

Original issue's description:
> [TextBlob] Fall back to TightRunBounds when the font bounds are empty
>
> Empty font bounds are likely an indication of a font bug.  As a best
> effort, we can use TightRunBounds in this easily detectable case.
>
> BUG=507022
> R=reed@google.com,bungeman@google.com
>
> Committed: https://skia.googlesource.com/skia/+/d6b99cc6b84b3ec864221cbe9945d203bd9eb072

TBR=bungeman@google.com,reed@google.com,fmalita@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=507022

Review URL: https://codereview.chromium.org/1283853002
2015-08-10 11:02:46 -07:00
bsalomon
91d844de47 Rename GrPipelineInfo to GrPipelineOptimizations
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/1274513005
2015-08-10 10:47:29 -07:00
joshualitt
7fc2a2610e Move GrStrokeRectBatch creation to behind factory
BUG=skia:

Review URL: https://codereview.chromium.org/1282283002
2015-08-10 10:30:14 -07:00
joshualitt
ecd1a69fbf Create GrRectBatchFactory
BUG=skia:

Review URL: https://codereview.chromium.org/1287433003
2015-08-10 10:08:26 -07:00
egdaniel
9d144ac15f This is a speculative fix for the crash on IOS
TBR=mtklein

Review URL: https://codereview.chromium.org/1277433005
2015-08-10 10:06:43 -07:00
fmalita
d6b99cc6b8 [TextBlob] Fall back to TightRunBounds when the font bounds are empty
Empty font bounds are likely an indication of a font bug.  As a best
effort, we can use TightRunBounds in this easily detectable case.

BUG=507022
R=reed@google.com,bungeman@google.com

Review URL: https://codereview.chromium.org/1284693002
2015-08-10 09:24:31 -07:00
joshualitt
9ff6425ce4 move Stroke Rect and AAFill Rect to their own file
BUG=skia:

Review URL: https://codereview.chromium.org/1282723004
2015-08-10 09:03:51 -07:00
djsollen
3a26fc8e9a Ensure that android "release" apps are signed with debug key
Review URL: https://codereview.chromium.org/1275223003
2015-08-10 08:58:04 -07:00
halcanary
4f2b33159b SkPDF: add assert for that SkWStream behaves.
Motivation:  this might catch future issues like this.

BUG=skia:4181

Review URL: https://codereview.chromium.org/1287443002
2015-08-10 08:49:03 -07:00
bsalomon
47dfc36e46 Use a factory function to create GrPipeline and remove unused member
Review URL: https://codereview.chromium.org/1273803004
2015-08-10 08:23:12 -07:00
joshualitt
d22f37cda7 Wire up testcreate function for GrDrawAtlasBatch
BUG=skia:

Review URL: https://codereview.chromium.org/1285593002
2015-08-10 08:02:58 -07:00
thakis
c5b7df48b2 Remove an unused function.
BUG=chromium:505316

Review URL: https://codereview.chromium.org/1282143002
2015-08-10 06:05:17 -07:00
reed
021f631dc6 api helpers inspired by blink use-cases
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1278323002
2015-08-09 19:41:13 -07:00
reed
41838a0194 remove unneeded _DRAWIMAGERECT flags
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1281123002
2015-08-07 19:09:09 -07:00
joshualitt
7375d6bab2 fixup precision with configurable atlas
BUG=skia:

Review URL: https://codereview.chromium.org/1276383003
2015-08-07 13:36:44 -07:00
scroggo
0df0e43488 Revert of Update libwebp and resume testing scaled webp (patchset #2 id:20001 of https://codereview.chromium.org/1280073002/ )
Reason for revert:
Compile failures, e.g.

http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Debug-Android_NoNeon/builds/1427/steps/build%20most/logs/stdio

Original issue's description:
> Update libwebp and resume testing scaled webp
>
> libwebp has a fix for [1]. Update to the commit that contains the fix.
>
> Update libwebp.gypi, corresponding to libwebp's latest makefile.
>
> Turn back on DM testing for scaled webp, now that it should no longer
> use uninitialized memory.
>
> Fix a warning in config.h
>
> [1] https://code.google.com/p/webp/issues/detail?id=254
>
> BUG=skia:4038
>
> Committed: https://skia.googlesource.com/skia/+/0575d3e6c272744a66ab3281f9871366717df339

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

Review URL: https://codereview.chromium.org/1278173004
2015-08-07 12:53:25 -07:00
scroggo
0575d3e6c2 Update libwebp and resume testing scaled webp
libwebp has a fix for [1]. Update to the commit that contains the fix.

Update libwebp.gypi, corresponding to libwebp's latest makefile.

Turn back on DM testing for scaled webp, now that it should no longer
use uninitialized memory.

Fix a warning in config.h

[1] https://code.google.com/p/webp/issues/detail?id=254

BUG=skia:4038

Review URL: https://codereview.chromium.org/1280073002
2015-08-07 12:49:16 -07:00
joshualitt
2771b5617c GrDrawVertices to batches
BUG=skia:

Review URL: https://codereview.chromium.org/1276333004
2015-08-07 12:46:26 -07:00