Commit Graph

18169 Commits

Author SHA1 Message Date
mtklein
ce2c5055ce Lay groundwork for SkOpts.
This doesn't really do anything yet.  It's just the CPU detection code, skeleton new .cpp files, and a few little .gyp tweaks.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1255193002
2015-07-27 10:52:33 -07:00
fmalita
9a5d1ab54d Make peekPixels() usable with raster surface snapshots
SkSurface_Raster snapshots do not lock their backing bitmaps when the
pixel ref is shared - they only lock on deep-copy.

But since for raster surfaces the pixels are always in memory, I think
it would be OK to also lock in the former case.

This allows for optimized (zero-copy) reads of raster surface snapshot
data.

R=reed@google.com

Review URL: https://codereview.chromium.org/1256993002
2015-07-27 10:27:29 -07:00
bsalomon
1c63436f39 Steal refs from other TextBatch in onCombineIfPossible
Review URL: https://codereview.chromium.org/1257683004
2015-07-27 07:00:00 -07:00
mtklein
cf4e567612 NEON has a ternary instruction.
Nothing seems to run any faster or slower, but it is terser.

BUG=skia:

Review URL: https://codereview.chromium.org/1255913004
2015-07-27 06:12:05 -07:00
bsalomon
d602f4d1f7 Make allocation count in TextBatch implicit
Review URL: https://codereview.chromium.org/1254903002
2015-07-27 06:12:01 -07:00
Brian Salomon
4239fc2f69 Remove skia_arch_width, fold into skia_arch_type.
DOCS_PREVIEW= https://skia.org/?cl=1228553010

BUG=skia:4042
R=borenet@google.com, mtklein@google.com

Review URL: https://codereview.chromium.org/1228553010
2015-07-27 09:10:36 -04:00
wangyix
cef14bf9ce Added GrGLBlend.h|cpp with helper function AppendPorterDuffBlend() in preparation for SkComposeShader gpu backend
BUG=skia:

Review URL: https://codereview.chromium.org/1254833003
2015-07-24 13:48:26 -07:00
joshualitt
20dac88565 mixed text blobs really draws LCD
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1261483002
2015-07-24 13:16:24 -07:00
djsollen
d18b861061 Update Android Apps to use gradle
This CL replaces ant with gradle for the task of building APKs.
The primary driver of this change is that it now allow us to
develop and test our apps using Android Studio.
DOCS_PREVIEW= https://skia.org/?cl=1215023017

Committed: https://skia.googlesource.com/skia/+/425535f1626932e4e22f61a2571f9c3c2b1c5977

Review URL: https://codereview.chromium.org/1215023017
2015-07-24 13:15:59 -07:00
caryclark
1818acb6a4 rename portable_typeface_always to portable_typeface
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1257773002
2015-07-24 12:09:25 -07:00
joshualitt
d9f13aef8d fix for GrAtlasTextContext occasionally crashes on mixed runs
TBR=bsalomon@google.com
BUG=510931

Review URL: https://codereview.chromium.org/1252423002
2015-07-24 11:24:31 -07:00
caryclark
37213558e6 make fontscalar gammatext lcdtext typeface verttext2 gm portable
Pass generic font names to tool util function to generate
platform specific fonts and gm test output by unique name.

R=bungeman@google.com

Review URL: https://codereview.chromium.org/1256903002
2015-07-24 11:08:01 -07:00
joshualitt
6c2c2b07ed Minimize retrieving SkGlyph in GrTextContext
BUG=skia:

Review URL: https://codereview.chromium.org/1257603005
2015-07-24 10:37:00 -07:00
robertphillips
29ccdf86ab Fix Ganesh drawAtlas bug with quad colors
Ganesh was not expanding the quad colors to vertex colors before calling drawVertices.

The new GM would've caught this bug and reveals Ganesh's limitations re the various xfer modes used with drawAtlas (i.e., w/o AA Ganesh only supports kModulate, w/ AA Ganesh only supports the coefficient-based xfer modes).

Review URL: https://codereview.chromium.org/1254943002
2015-07-24 10:20:45 -07:00
bsalomon
965b36cb16 Set preallocated TextBatch geometries to 4 rather than 32
Review URL: https://codereview.chromium.org/1256843003
2015-07-24 08:10:43 -07:00
hendrikw
266c232104 skia: wrong calling convention on eglGetPlatformDisplayEXT
When attempting to run the release compile of nanobench on windows, I would
immediately crash due to c++'s buffer security check.

This was caused by calling the function with the wrong calling
convention.  I'm not sure how this ever worked for anyone.

Anyway, fix is to use eglext.h's version of the function definition.

Review URL: https://codereview.chromium.org/1250383002
2015-07-24 06:52:40 -07:00
caryclark
ba9757abc2 make dftext gm not overlap itself
TBR=jvanverth@google.com

Review URL: https://codereview.chromium.org/1253643004
2015-07-23 14:07:58 -07:00
caryclark
1b31402bab make fontcache textblob gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1245123006
2015-07-23 13:48:31 -07:00
caryclark
d4349723fa fix path ops fuzz buster
Mark collapsed segments as done and remove collapsed
segment references from the coincidence array.

Also add test names to global debugging.

R=fmalita@chromium.org
BUG=512592

Review URL: https://codereview.chromium.org/1250293002
2015-07-23 12:40:22 -07:00
caryclark
a0170f10aa make dftext the same on Linux and Android
Use the same font sizes on both platforms so that the gm images
are easier to compare one to the other.

TBR=jvanverth@google.com

Review URL: https://codereview.chromium.org/1253573006
2015-07-23 12:38:59 -07:00
bsalomon
a449779a33 Remove test of illegal behavior that modifies a texture backing an SkImage.
Review URL: https://codereview.chromium.org/1244143004
2015-07-23 12:22:19 -07:00
msarett
a56884c17f Fix Android x86 compile on mac
It appears I failed to fully disable it on the first attempt.

BUG=skia:

Review URL: https://codereview.chromium.org/1249083004
2015-07-23 11:57:13 -07:00
hendrikw
4e34001ec0 Skia: ANGLE Roll
Includes fix for vertex index.

BUG=510585

Review URL: https://codereview.chromium.org/1246143005
2015-07-23 11:56:40 -07:00
caryclark
3b0f98ee17 fix typeface leak
TBR=bungeman@google.com

Review URL: https://codereview.chromium.org/1239303003
2015-07-23 11:52:01 -07:00
bsalomon
494aa593c5 Fix ImageNewSurface test on S4.
This still leaves the SkImage_NewFromTexture broken.

Review URL: https://codereview.chromium.org/1253513004
2015-07-23 11:45:02 -07:00
robertphillips
eb86b55fe9 Fix variable shadowing in SkMorphologyImageFilter
Review URL: https://codereview.chromium.org/1245883005
2015-07-23 11:35:08 -07:00
jvanverth
29c69793f0 Update fallback rsqrt implementation to use optimal constants.
Improves max relative error from 0.00175126 to 0.000650197.
Also add unit tests to check error bounds.

BUG=chromium:511458

Review URL: https://codereview.chromium.org/1251423002
2015-07-23 11:14:29 -07:00
joshualitt
4765bdcd63 fix comment on GrBatchTextStrike
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1252783002
2015-07-23 10:58:48 -07:00
caryclark
e663341605 fix typo
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1245993003
2015-07-23 09:11:58 -07:00
mtklein
b9c47f9968 Have Windows use _mm_rsqrt_ss too.
Tidy up a little while I'm in here:
  1) SIMD headers are now included by SkTypes.h as appropriate.
  2) _mm_cvtss_f32() is pithier and generates the same code.

Looks like this is the only code checking for SSE wrong.  After this CL:
    ~/skia (sse) $ git grep __SSE
    include/core/SkPreConfig.h:    #if defined(__SSE4_2__)
    include/core/SkPreConfig.h:    #elif defined(__SSE4_1__)
    include/core/SkPreConfig.h:    #elif defined(__SSE3__)
    include/core/SkPreConfig.h:    #elif defined(__SSE2__)
every other check is in SkPreConfig.h where it belongs.

This is going to affect some GMs subtly on Windows.

BUG=chromium:511458

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

Review URL: https://codereview.chromium.org/1248503004
2015-07-23 08:37:02 -07:00
joshualitt
11dfc8e57a Small tweak to TextBlobCacheTest
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1251383003
2015-07-23 08:30:25 -07:00
joshualitt
bedf7e5c0e fix memory leak in TextBlobCacheTest
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1252593002
2015-07-23 08:09:35 -07:00
bsalomon
398260262f Attempt to somewhat simplify GrContext::readSurfacePixels interaction with GrGpu.
Review URL: https://codereview.chromium.org/1255483005
2015-07-23 08:07:21 -07:00
rmistry
6d600af80a Fix formatting in the CQ keywords markdown
BUG=skia:
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1247323002
TBR=jcgregorio

Review URL: https://codereview.chromium.org/1247323002
2015-07-23 08:02:13 -07:00
wangyix
150714fb16 Name of primitive processor will now be printed in generated shader code
BUG=skia:

Review URL: https://codereview.chromium.org/1253513003
2015-07-23 08:02:09 -07:00
joshualitt
9efef7b56f Revert "Update Android Apps to use gradle"
This reverts commit 425535f162.

NOTRY=true
NOTREECHECKS=true
TBR=djsollen@google.com
BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1250233002

Review URL: https://codereview.chromium.org/1250233002
2015-07-23 08:00:33 -07:00
wangyix
7c157a9888 Added GrGLFragmentProcessor::EmitArgs struct for use with emitCode()
BUG=skia:

Review URL: https://codereview.chromium.org/1251173002
2015-07-22 15:08:53 -07:00
borenet
243406e580 Add skia_use_android_framework_defines GYP_DEFINE
BUG=skia:4082

Review URL: https://codereview.chromium.org/1243383002
2015-07-22 13:29:25 -07:00
robertphillips
ff0ca5ed82 Misc cleanup
This is split off of https://codereview.chromium.org/1225923010/ (Start tightening correspondence betweeen GrDrawContext and GrRenderTarget). It:

fixes some style nits
replaces some passing of GrContext with GrTextureProvider & GrDrawContext
does a bit of the finer grained creation of GrDrawContexts

Review URL: https://codereview.chromium.org/1245183002
2015-07-22 11:54:44 -07:00
djsollen
425535f162 Update Android Apps to use gradle
This CL replaces ant with gradle for the task of building APKs.
The primary driver of this change is that it now allow us to
develop and test our apps using Android Studio.
DOCS_PREVIEW= https://skia.org/?cl=1215023017

Review URL: https://codereview.chromium.org/1215023017
2015-07-22 11:33:25 -07:00
joshualitt
404d9d620d Fix up textblobcachetest
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1250003003
2015-07-22 11:00:32 -07:00
mtklein
ced1585149 565 support for SIMD xfermodes
This uses the most basic approach possible:
  - to load an Sk4px from 565, convert to SkPMColors on the stack serially then load those SkPMColors.
  - to store an Sk4px to 565, store to SkPMColors on the stack then convert to 565 serially.

Clearly, we can optimize these loads and stores.  That's a TODO.

The code using SkPMFloat is the same idea but a little more long-term viable, as we're only operating on one pixel at a time anyway.  We could probably write 565 <-> SkPMFloat methods, but I'd rather not until it's really compelling.

The speedups are varied but similar across SSE and NEON: a few uninteresting, many 50% faster, some 2x faster, and SoftLight ~4x faster.

This will cause minor GM diffs, but I don't think any layout test changes.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/942930dcaa51f66d82cdaf46ae62efebd16c8cd0

Committed: https://skia.googlesource.com/skia/+/860dcaa2ddfdadc050af4f943a84a9d499315066

Review URL: https://codereview.chromium.org/1245673002
2015-07-22 10:52:53 -07:00
fmalita
651c920d2f Add drawImage{Rect,} support to SkDebugCanvas
R=robertphillips@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1253473002
2015-07-22 10:23:01 -07:00
wangyix
6af0c93943 Moved GrGLFragmentProcessor definition to its own file
BUG=skia:

Review URL: https://codereview.chromium.org/1246193002
2015-07-22 10:21:17 -07:00
bsalomon
265697d91b Remove some redundant fields from BitmapTextBatch (and rename to TextBatch).
Review URL: https://codereview.chromium.org/1244093004
2015-07-22 10:17:26 -07:00
hendrikw
1ae488f78b skia: GrGLAssembleGLInterface update load chromium extension functions
Command buffer will expose GL_CHROMIUM_framebuffer_multisample and
GL_CHROMIUM_map_sub, added support for these to enable interface
validation to succeed.

Review URL: https://codereview.chromium.org/1248853003
2015-07-22 09:30:08 -07:00
msarett
551369163f Fix Android framework build
The Android framework was failing on conditions in
libjpeg-turbo.gyp, even though libjpeg-turbo is listed
in dependencies! for the framework (maybe because I
forgot to add export_dependent_settings!).  This is fixed
by rearranging the gyp file.

BUG=skia:

Review URL: https://codereview.chromium.org/1249003002
2015-07-22 09:08:28 -07:00
jvanverth
3fc656006c Fix tile drop-out on S4 for texture decal mode.
Switch to use highp on interpolants.
Also removes some unnecessary formatting.

BUG=skia:3381

Review URL: https://codereview.chromium.org/1245703004
2015-07-22 08:41:51 -07:00
borenet
4cb300340e Coverage: add a trace for not_covered_lines per file
Example output:

{
    "build_number": "2",
    "gitHash": "71f5db892ee7ed9fbb573da28ccb906e18ba24a4",
    "key": {
        "arch": "x86_64",
        "compiler": "Clang",
        "configuration": "Coverage",
        "cpu_or_gpu": "CPU",
        "cpu_or_gpu_value": "AVX2",
        "model": "GCE",
        "os": "Ubuntu"
    },
    "results": {
        "dm_DMGpuSupport_h": {
            "coverage": {
                "lines_not_covered": 6,
                "options": {
                    "dir": "dm",
                    "fullname": "dm/DMGpuSupport.h",
                    "source_type": "coverage"
                },
                "percent": 33.33333333333333
            }
        },
        "dm_DMJsonWriter_cpp": {
......

BUG=skia:2430

Review URL: https://codereview.chromium.org/1246043002
2015-07-22 08:19:25 -07:00
scroggo
b636b45971 Add the ability to decode a subset to SkCodec
This allows codecs that support subsets natively (i.e. WEBP) to do so.

Add a field on SkCodec::Options representing the subset.

Add a method on SkCodec to find a valid subset which approximately
matches a desired subset.

Implement subset decodes in SkWebpCodec.

Add a test in DM for decoding subsets.
Notice that we only start on even boundaries. This is due to the
way libwebp's API works. SkWEBPImageDecoder does not take this into
account, which results in visual artifacts.

FIXME: Subsets with scaling are not pixel identical, but close. (This
may be fine, though - they are not perceptually different. We'll just
need to mark another set of images in gold as valid, once
https://skbug.com/4038 is fixed, so we can tests scaled webp without
generating new images on each run.)

Review URL: https://codereview.chromium.org/1240143002
2015-07-22 07:16:20 -07:00