Commit Graph

5420 Commits

Author SHA1 Message Date
Robert Phillips
8d5ce2d9ed Patch up ref counting of proxies
Bug: skia:
Change-Id: If746283d788368bf7aad6d285f181d8531768e61
Reviewed-on: https://skia-review.googlesource.com/70024
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-11-13 13:22:20 +00:00
Mike Klein
24e4cc7087 disable Android-specific SkTypeface test
Seems like this is testing the Android SkFontMgr via SkTypeface.
I would like to replace it with that test directly.

Change-Id: Iea7a16a3afcda4f89f367f5da4090660329f95d1
Reviewed-on: https://skia-review.googlesource.com/70460
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-12 17:03:36 +00:00
Herb Derby
66498bc416 Try 2 for Gauss filter calculation
Originally reviewed at:
https://skia-review.googlesource.com/c/skia/+/67723

Change-Id: Ie62d81f818899f3a79df888c1594d3fbccf6d414
Reviewed-on: https://skia-review.googlesource.com/69681
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-11-10 19:58:57 +00:00
Mike Klein
10d66cc3f8 move Sk{Test,Random}ScalerContext to tools
There's no need for Skia users to link this test code.

Change-Id: I9d6ef2a053d0cf5cb916aa254389ca819c48bae1
Reviewed-on: https://skia-review.googlesource.com/69922
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-10 17:02:20 +00:00
Mike Klein
cb6940bf42 DM FontMgr updates
- return nullptr for the various makeFromFoo() that we can't support,
    and tweak a few unit tests to bail out early when they do

  - create FontStyleSet and SkTypefaces once

  - abort early from FontHostStream if we can't openStream()

  - implement SkTestTypeface::onCreateFamilyNameIterator()
    with SkOTUtils::LocalizedStrings_SingleName() so FontNames passes

  - pin out-of-range glyph IDs to zero in SkTestTypeface

Change-Id: Iac53265e331fc1c5c507513af3ab299063e6610a
Reviewed-on: https://skia-review.googlesource.com/69501
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-10 15:30:57 +00:00
Herb Derby
66918078bb Revert "Gauss filter calculation"
This reverts commit 53ec7dc7cb.

Reason for revert: Segv on very specific machines.

Original change's description:
> Gauss filter calculation
> 
> Change-Id: I921ef815d4f788c312aa729f353b6ea154140555
> Reviewed-on: https://skia-review.googlesource.com/67723
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=herb@google.com,robertphillips@google.com

Change-Id: I15164809d081dee0076e815b40fbfdbc6374cfba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/69641
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-11-09 22:39:57 +00:00
Herb Derby
53ec7dc7cb Gauss filter calculation
Change-Id: I921ef815d4f788c312aa729f353b6ea154140555
Reviewed-on: https://skia-review.googlesource.com/67723
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-11-09 20:18:17 +00:00
Chris Dalton
fc31be40ce Harden SkClassifyCubic
BUG=chromium:743617
Change-Id: Idfb89832b48ebd60fd9109cd526bdd5cd5931ada
Reviewed-on: https://skia-review.googlesource.com/68980
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-11-09 16:08:44 +00:00
Cary Clark
df429f3bea move parts of SkPoint to SkPointPriv
Move specialized SkPoint methods to SkPointPriv.
Use constexpr and inline initialization where possible.

R=reed@google.com,bsalomon@google.com
Bug: skia: 6898
Change-Id: I01ec5186f010f2dc80c068c70d9cc352f3221338
Reviewed-on: https://skia-review.googlesource.com/68700
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2017-11-08 18:25:17 +00:00
Brian Osman
63bc48d093 Add MakeCrossContextFromPixmap
This operates just like MakeCrossContextFromEncoded, but starting from
raster data. This version is defensive (always uses copies if a raster
image needs to be made).

Bug: skia:
Change-Id: Ibc2b9a235c89a41fbbfd022d943f15ac212d0677
Reviewed-on: https://skia-review.googlesource.com/68205
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-07 15:59:38 +00:00
Ethan Nicholas
82a62d2d4e Revert "refactored SkSLVarDeclaration out of existence"
This reverts commit 1ae353c887.

Reason for revert: ASAN failures

Original change's description:
> refactored SkSLVarDeclaration out of existence
> 
> Bug: skia:
> Change-Id: I3dbc08e6d759f6828a472246d4797babb6cc132e
> Reviewed-on: https://skia-review.googlesource.com/66147
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

TBR=egdaniel@google.com,ethannicholas@google.com

Change-Id: I8cae451de1546fe783e32dd41df00eac7da61b21
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/68280
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-07 14:42:19 +00:00
Ethan Nicholas
1ae353c887 refactored SkSLVarDeclaration out of existence
Bug: skia:
Change-Id: I3dbc08e6d759f6828a472246d4797babb6cc132e
Reviewed-on: https://skia-review.googlesource.com/66147
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-07 14:28:18 +00:00
Cary Clark
74f623d161 make point array methods private
Moved method are not used by chromium, google3,
or android.

SkPoint::setRectIFan isn't used or tested at all.

SkPoint::setRectFan and SkPoint::setRectTriStrip
are only used internally.

These routines pretend that a SkPoint is part
of an array of points. Since that's kind of an
odd contract to make public, and because they
aren't used outside of Skia, relegate them to
a priv file.

R=bsalomon@google.com,reed@google.com
Bug: skia: 6898
Change-Id: I5ec2eb47799f6fd4b2994da962b1fa69ce659931
Reviewed-on: https://skia-review.googlesource.com/68121
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-11-07 13:10:38 +00:00
Chris Dalton
080baa44c5 Fix dangling pointers when Ganesh culls CCPR Ops early
BUG=chromium:775868

Change-Id: I0066e34fd8ebe4b46ad72481f5bb955dc0dd5910
Reviewed-on: https://skia-review.googlesource.com/67682
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-11-07 01:56:37 +00:00
Chris Dalton
fddb6c0399 Setup CCPR testing with GrMockContext
Beefs up the mock context to be able to support CCPR, sets up a
framework for testing CCPR with the mock context, and adds a new test.

Bug: skia:
Change-Id: If95f92726f7b1a7f52ad04ca8126551f58ea8032
Reviewed-on: https://skia-review.googlesource.com/67980
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-11-06 20:44:19 +00:00
Cary Clark
60aaeb2b55 create imagepriv and name params
Named all parameters and made the names consistent
for documentation.

Moved SK_IMAGEFILTER_UNFLATTEN_COMMON to private file.

TBR=reed@google.com
Bug: skia:6898
Change-Id: I1343d2b16d4217088fa3bc9c40f1f4177fa32740
Reviewed-on: https://skia-review.googlesource.com/66521
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-11-03 13:56:30 +00:00
Greg Daniel
c77085d2e0 Remove content area from GrTextureAdjuster.
Bug: skia:
Change-Id: I77854ee22303afe5787bf3094bca2db1a3dcf5ef
Reviewed-on: https://skia-review.googlesource.com/66149
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-02 13:11:31 +00:00
Leon Scroggins III
f78b55cb94 Simplify SkColorSpace::MakeICC
Rather than restricting the supported ICC types in MakeICC, create any
ICC type that we support, and make the client reject them as necessary
by querying the SkColorSpace::Type.

Remove ICCTypeFlag and replace uses of it with SkColorSpace::Type.

This depends on a change in Chromium
(https://chromium-review.googlesource.com/c/chromium/src/+/741843).
Without that, this change will start allowing non-CMYK images to use
CMYK profiles.

Bug: 727128
Change-Id: I085b4665e49bc80083264496d864cc4cd62ae914
Reviewed-on: https://skia-review.googlesource.com/64841
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-10-31 18:13:04 +00:00
Greg Daniel
45d6303f6e Have mip status match surface when snapping image from wrapped object
Also fixes some bugs involved with creating mipped SkSurfaces.

Bug: skia:
Change-Id: I6e0109000eadd2bdee4a907d3ee2231104528165
Reviewed-on: https://skia-review.googlesource.com/65063
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-30 20:06:53 +00:00
Greg Daniel
65c7f662ba Add mip support to GrAHardwareBufferImageGenerator
Bug: skia:
Change-Id: I482d8f9937c86ed441016afef2d8f924282dd17a
Reviewed-on: https://skia-review.googlesource.com/63861
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-30 19:18:03 +00:00
Robert Phillips
0b6a3e4e5e Revert "Revert "Fix Debian9-Clang build""
This reverts commit dd992c4a46.

Reason for revert: Suppression have landed for failing tests

Original change's description:
> Revert "Fix Debian9-Clang build"
> 
> This reverts commit 08d73a4850.
> 
> Reason for revert: vulkan failure
> 
> Original change's description:
> > Fix Debian9-Clang build
> > 
> > TBR=bsalomon@google.com
> > Change-Id: I2e86aa0381d409f1205bdaba4117253cb381b404
> > Reviewed-on: https://skia-review.googlesource.com/65020
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: Ie934d2c85857d087721885c28aa02c3c8579e7fc
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/65200
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I6cea9a2d580e68a6ed8228bb7f076a98766d4bf9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/65203
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-30 18:05:09 +00:00
Robert Phillips
ec32534729 Revert "Revert "Fix GrDefaultPathRender inversely wound path bug""
This reverts commit fc28138c04.

Reason for revert: Suppression have landed for failing tests

Original change's description:
> Revert "Fix GrDefaultPathRender inversely wound path bug"
> 
> This reverts commit 511a9d4999.
> 
> Reason for revert: vulkan
> 
> Original change's description:
> > Fix GrDefaultPathRender inversely wound path bug
> > 
> > Bug: 769898
> > Change-Id: I3b1a43b1e114b35105493a0cfa01a1f01b65fa56
> > Reviewed-on: https://skia-review.googlesource.com/64065
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: Ib1a987294d14f0526bf5ff5a8fd90bbd5f6f3a0d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 769898
> Reviewed-on: https://skia-review.googlesource.com/65201
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I3a3543c46b3192f1ffd31a5566cf337dc03561a8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 769898
Reviewed-on: https://skia-review.googlesource.com/65202
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-30 18:02:59 +00:00
Mike Klein
03141d25cf remove SkThread, using std::thread instead
Change-Id: I871dd5eea4496e87c206b46d9eae81cb521b11ce
Reviewed-on: https://skia-review.googlesource.com/65103
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-10-30 16:45:29 +00:00
Robert Phillips
fc28138c04 Revert "Fix GrDefaultPathRender inversely wound path bug"
This reverts commit 511a9d4999.

Reason for revert: vulkan

Original change's description:
> Fix GrDefaultPathRender inversely wound path bug
> 
> Bug: 769898
> Change-Id: I3b1a43b1e114b35105493a0cfa01a1f01b65fa56
> Reviewed-on: https://skia-review.googlesource.com/64065
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Ib1a987294d14f0526bf5ff5a8fd90bbd5f6f3a0d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 769898
Reviewed-on: https://skia-review.googlesource.com/65201
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-30 15:58:03 +00:00
Robert Phillips
dd992c4a46 Revert "Fix Debian9-Clang build"
This reverts commit 08d73a4850.

Reason for revert: vulkan failure

Original change's description:
> Fix Debian9-Clang build
> 
> TBR=bsalomon@google.com
> Change-Id: I2e86aa0381d409f1205bdaba4117253cb381b404
> Reviewed-on: https://skia-review.googlesource.com/65020
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Ie934d2c85857d087721885c28aa02c3c8579e7fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/65200
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-30 15:55:29 +00:00
Robert Phillips
08d73a4850 Fix Debian9-Clang build
TBR=bsalomon@google.com
Change-Id: I2e86aa0381d409f1205bdaba4117253cb381b404
Reviewed-on: https://skia-review.googlesource.com/65020
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-30 13:01:08 +00:00
Robert Phillips
511a9d4999 Fix GrDefaultPathRender inversely wound path bug
Bug: 769898
Change-Id: I3b1a43b1e114b35105493a0cfa01a1f01b65fa56
Reviewed-on: https://skia-review.googlesource.com/64065
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-10-30 11:47:28 +00:00
Chris Dalton
7947193c31 Merge clip rects in GrReducedClip
Merges the intersection of all rect clips into a single clip rect
element. This is also the first step toward better handling of the
subtractive elements.

Bug: skia:
Change-Id: I36bd9c256874917adb68f43e8faddc609e65f37a
Reviewed-on: https://skia-review.googlesource.com/64380
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-10-27 19:16:44 +00:00
Fredrik Söderquist
b87f798e5a Consistently round fOffset in SkOffsetImageFilter
Since SkScalarRoundToInt rounds differently depending on the sign of the
value, care must be taken to perform rounding before any potential
change to the sign - like in SkOffsetImageFilter::onFilterNodeBounds.

Bug: chromium:778204
Change-Id: I3debff7565f45022c7b8566662927149850b1bea
Reviewed-on: https://skia-review.googlesource.com/64020
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-26 13:10:07 +00:00
Brian Salomon
4cbb6e6d55 Pass GrRenderTargetContext's GrColorSpaceInfo to SkShader and SkColorFilter.
Also to SkColorTo(Premul|Unpremul)GrColor4f.

This can avoid cache lookups to find GrColorSpaceXforms as the xform pointer is stored in GrColorSpaceInfo after the first lookup.

Also uses GrColorSpaceInfo to construct GrTextUtils::Paint.

Bug: skia:
Change-Id: Idf19d512a60d2269e6921c7fb54d93aee499a70d
Reviewed-on: https://skia-review.googlesource.com/63660
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-10-25 19:32:20 +00:00
Chris Dalton
c17bf32a1b Convert geometry shaders to operate in Skia device space
Defers the transformation to normalized window coordinates until after
the geometry shader. Merges vertex and a geometry shader builders into
a single compilation unit with a common base class.  Updates CCPR
geometry shaders accordingly.

Bug: skia:
Change-Id: If93c90e978b1fdc7120febd05cfb05810fd496b5
Reviewed-on: https://skia-review.googlesource.com/62980
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-10-25 15:59:18 +00:00
Mike Klein
be0bd92561 more easy lowp shader stages
This fills out a couple more matrix and gather stages.

Deletes a not particularly important unit test that was using a
scale matrix in a weird, non-lowp compatible way.

This will require guards for Blink layout tests.

Change-Id: I54cb228ff541f771e8f4758f07d26c5161d48af3
Reviewed-on: https://skia-review.googlesource.com/62520
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-10-24 17:31:51 +00:00
Greg Daniel
e252f08982 Add hint to SkSurface::MakeRenderTarget that we will use mips
Additionally this changed triggered a cascade of plumbing GrMipMapped
down throughout Ganesh.

Bug: skia:
Change-Id: I4181f44d9046d66139bb491c7abf86703305aaeb
Reviewed-on: https://skia-review.googlesource.com/63000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-23 20:25:59 +00:00
Greg Daniel
261b8aa1de Revert "Revert "Support creation/use of mipped proxy in GrBackendTextureImageGenerator""
This reverts commit 7477d96938.

Reason for revert: Putting in fixes in tests

Original change's description:
> Revert "Support creation/use of mipped proxy in GrBackendTextureImageGenerator"
> 
> This reverts commit b8ad00b5a6.
> 
> Reason for revert: Some various test failures 
> 
> Original change's description:
> > Support creation/use of mipped proxy in GrBackendTextureImageGenerator
> > 
> > Bug: skia:
> > Change-Id: I9d06780ccb2db0865100b67041c03408f2445c62
> > Reviewed-on: https://skia-review.googlesource.com/61241
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
> 
> Change-Id: I28e625776352ee6f9f27e66cd5d4b149ef50a22a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/61941
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: Ibfbca5101b06d9ff8f8a5d33bc6f2114806db552
Reviewed-on: https://skia-review.googlesource.com/62561
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-10-23 15:32:15 +00:00
Brian Osman
1cb41717bc Remove color space xform support from SkSL
Bug: skia:
Change-Id: Ia50c1f750e4626211f012ae7543db126b10134c3
Reviewed-on: https://skia-review.googlesource.com/61906
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-23 15:27:12 +00:00
Cary Clark
6d6d603c81 make matrix serialization private
Moves readFromMemory, writeToMemory to private section.
No sign that these are called from google3, android,
chromium, but function names are common enough that
it's hard to know for sure.

These are used inside templates internally and for
testing, so it is not quite as simple as adding alternate
entry points in SkMatrixPriv.

R=reed@google.com
Bug: skia:6898
Change-Id: I1fac142f4bf0f38608ea93438c46f39147606c4d
Reviewed-on: https://skia-review.googlesource.com/62361
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-10-20 16:49:57 +00:00
Robert Phillips
dbfecd06ad Re-land unit test for clear bug (w/ AMD work-arounds)
Bug: 768134
Change-Id: I76e5e3ff5719b0d2f9c74d49dfa9e187e4da7c1f
Reviewed-on: https://skia-review.googlesource.com/60562
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-on: https://skia-review.googlesource.com/61221
2017-10-20 15:49:25 +00:00
Benjamin Kramer
a8dacf3cff Remove unused variables from test
Clang trunk warns about them.

Bug: skia:
Change-Id: Id926145f8310f55d42d03fd9288fcb7b3135a612
Reviewed-on: https://skia-review.googlesource.com/62080
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2017-10-19 22:29:25 +00:00
Greg Daniel
7477d96938 Revert "Support creation/use of mipped proxy in GrBackendTextureImageGenerator"
This reverts commit b8ad00b5a6.

Reason for revert: Some various test failures 

Original change's description:
> Support creation/use of mipped proxy in GrBackendTextureImageGenerator
> 
> Bug: skia:
> Change-Id: I9d06780ccb2db0865100b67041c03408f2445c62
> Reviewed-on: https://skia-review.googlesource.com/61241
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com

Change-Id: I28e625776352ee6f9f27e66cd5d4b149ef50a22a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/61941
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-19 13:59:37 +00:00
Greg Daniel
b8ad00b5a6 Support creation/use of mipped proxy in GrBackendTextureImageGenerator
Bug: skia:
Change-Id: I9d06780ccb2db0865100b67041c03408f2445c62
Reviewed-on: https://skia-review.googlesource.com/61241
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-19 13:09:16 +00:00
Leon Scroggins III
b6ab10f34b Move SkCodec::Origin into its own file
It is now used by SkPixmap and will soon be in SkJpegEncoder. No need
for those to depend on SkCodec.

Bug: 768878
TBR=reed@google.com
(reed@ already approved the API change in
https://skia-review.googlesource.com/60721)
Change-Id: If1a6e1d5b60a7a3d8c97818e15a48d28ba804668
Reviewed-on: https://skia-review.googlesource.com/61680
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-10-18 19:08:16 +00:00
Brian Osman
2240be96d9 Remove color space xform from GrTextureDomain & GrSimpleTextureEffect
Bug: skia:
Change-Id: I31435d334da28cce9bbc654c4b98746b03078897
Reviewed-on: https://skia-review.googlesource.com/61460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-18 18:46:25 +00:00
Ben Wagner
021e5c7016 Revert "Add an Option for orientation on JPEG encodes"
This reverts commit 5411a60e0d.

Reason for revert: ASAN and Coverage failing: https://chromium-swarm.appspot.com/task?id=394978f3b7d44610
Flutter_Android failing.

Original change's description:
> Add an Option for orientation on JPEG encodes
> 
> Move Origin to its own header so that SkPixmap and SkJpegEncoder need
> not depend on SkCodec.
> 
> Add libexif, which is already used by Android, and use it to write the
> orientation. Write a makefile based on the Android.bp in Android, minus
> warnings. (libexif has an LGPL license.)
> 
> Add a test that verifies all the orientations work.
> 
> Optionally enable writing the orientation (and therefore including
> libexif). Chromium does not currently need it, and Android does not
> expose an API that would allow using it. Disable on Windows, where we
> still have build errors to fix.
> 
> Bug: skia:7138
> Change-Id: Iaeff44c36aebe0e639666979dc00e1b7594bbeb1
> Reviewed-on: https://skia-review.googlesource.com/60721
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Mike Reed <reed@google.com>

TBR=mtklein@chromium.org,mtklein@google.com,scroggo@google.com,reed@google.com

Change-Id: I05b7ae8d1c5bbd1de1642d9ef024943500256273
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7138
Reviewed-on: https://skia-review.googlesource.com/61620
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2017-10-18 18:09:47 +00:00
Leon Scroggins III
5411a60e0d Add an Option for orientation on JPEG encodes
Move Origin to its own header so that SkPixmap and SkJpegEncoder need
not depend on SkCodec.

Add libexif, which is already used by Android, and use it to write the
orientation. Write a makefile based on the Android.bp in Android, minus
warnings. (libexif has an LGPL license.)

Add a test that verifies all the orientations work.

Optionally enable writing the orientation (and therefore including
libexif). Chromium does not currently need it, and Android does not
expose an API that would allow using it. Disable on Windows, where we
still have build errors to fix.

Bug: skia:7138
Change-Id: Iaeff44c36aebe0e639666979dc00e1b7594bbeb1
Reviewed-on: https://skia-review.googlesource.com/60721
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2017-10-18 17:38:15 +00:00
Mike Klein
85f8536ca2 Feed seed_shader() iota through a context pointer.
As this array grows longer it causes troublesome code generation
when we're compiling offline, but it's easy as an argument.

Change-Id: I53526443f534f29d3bff17c3aec24a9e916c9b86
Reviewed-on: https://skia-review.googlesource.com/60564
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2017-10-18 16:17:55 +00:00
Cary Clark
e4442cb0b5 convert mapHomogeneousPoints to SkPoint3
SkMatrix::mapHomogeneousPoints takes an array of SkScalar,
but expects essentially SkPoint3, so make it so.


R: robertphillips@google.com, reed@google.com
Bug: skia:6898
Change-Id: Ibaf8b05c08b7df16c67d6a77d914667ace9a70da
Reviewed-on: https://skia-review.googlesource.com/58380
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-10-18 16:09:46 +00:00
Mike Klein
494cfcd3f9 Revert "Remove some blur tests on google3 until the flag is removed."
This reverts commit a0020f987e.

Reason for revert: don't need this

Original change's description:
> Remove some blur tests on google3 until the flag is removed.
> 
> Change 52771 is causing google3 to fail because some tests changed
> and were not guarded by a legacy flag.
> 
> Change-Id: I7ad5b83315bba98744f89860dd03fffc66a88248
> Reviewed-on: https://skia-review.googlesource.com/60740
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>

TBR=mtklein@chromium.org,mtklein@google.com,herb@google.com

Change-Id: Ib4f102442f6b11c276e020406808bd88344657a5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/61321
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2017-10-18 15:27:56 +00:00
Brian Salomon
43f8bf0f78 Move clear-as-draw workaround to GrGLGpu and expose via GrContextOptions.
Bug: skia:7154
Change-Id: I23ffc11dab4a377fbd6b7e4e33722b3fa0793d58
Reviewed-on: https://skia-review.googlesource.com/60681
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-10-18 12:55:06 +00:00
Brian Salomon
57caa660c0 Revert "Revert "Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.""
This reverts commit 62563deb6b.

Reason for revert: change that affected similar set of GMs reverted, relanding now that this is more easily triagable.

Original change's description:
> Revert "Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans."
> 
> This reverts commit fa2d604a7d.
> 
> Reason for revert: <INSERT REASONING HERE>
> 
> Original change's description:
> > Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.
> > 
> > Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.
> > 
> > I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.
> > 
> > 
> > Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
> > Reviewed-on: https://skia-review.googlesource.com/60081
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I7c4c23aa418da09c9708b28cce64ab58e282dd3a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/60683
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Iefcd16676a7617d32e89fc84206cd4e88e9a06e1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/61160
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-18 12:21:17 +00:00
Herb Derby
59f8f15487 Revert "Use combined three pass code for image blur."
This reverts commit d4a0fc7383.

Reason for revert: Too naive about bounds

Original change's description:
> Use combined three pass code for image blur.
> 
> This changes more closely matches the GL output, and the runtimes are similar or
> faster for the common cases.
> 
> x86_64 times:
> benchmark                            old-Us   new-Us   old/new
> blur_image_filter_large_80.00_80.00  4842.04  2626.10  1.84381
> blur_image_filter_small_80.00_80.00  3297.72  854.97   3.85712
> blur_image_filter_large_10.00_10.00  930.44   720.50   1.29138
> blur_image_filter_small_10.00_10.00  69.96    42.15    1.65979
> blur_image_filter_large_1.00_1.00    682.66   521.78   1.30833
> blur_image_filter_small_1.00_1.00    19.21    14.43    1.33125
> blur_image_filter_large_0.50_0.50    696.17   64.14    10.8539
> blur_image_filter_small_0.50_0.50    16.26    5.02     3.23904
> 
> arm64 times:
> benchmark                            old-Us    new-Us    old/new
> blur_image_filter_large_80.00_80.00  42144.53  14128.42  2.98296
> blur_image_filter_small_80.00_80.00  24840.58  4392.58   5.65512
> blur_image_filter_large_10.00_10.00  3556.40   3793.70   0.937449
> blur_image_filter_small_10.00_10.00  282.53    220.62    1.28062
> blur_image_filter_large_1.00_1.00    2502.20   2937.99   0.851671
> blur_image_filter_small_1.00_1.00    83.32     81.93     1.01697
> blur_image_filter_large_0.50_0.50    5643.80   272.83    20.6861
> blur_image_filter_small_0.50_0.50    141.02    38.29     3.68295
> 
> Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD
> Change-Id: Ic53b3186607d5485477b92e4ca7b092bf1366c52
> Reviewed-on: https://skia-review.googlesource.com/52771
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,herb@google.com,senorblanco@chromium.org

Change-Id: Idf679a8fc6d777625ad9527b843aa1614d878cba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD
Reviewed-on: https://skia-review.googlesource.com/60900
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-10-17 22:27:33 +00:00
Herb Derby
a0020f987e Remove some blur tests on google3 until the flag is removed.
Change 52771 is causing google3 to fail because some tests changed
and were not guarded by a legacy flag.

Change-Id: I7ad5b83315bba98744f89860dd03fffc66a88248
Reviewed-on: https://skia-review.googlesource.com/60740
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-10-17 19:42:50 +00:00
Robert Phillips
bcc8e9bf3f Revert "Add unit test for clear bug"
This reverts commit 2fb81c04d7.

Reason for revert: Apparently no gpu can consistently perform a full screen clear

Original change's description:
> Add unit test for clear bug
> 
> Bug: 768134
> Change-Id: Ifb5a0eaeb85a8f399204467c22d0845d630d0d3d
> Reviewed-on: https://skia-review.googlesource.com/60562
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I88434e55e5391e858ee7c37873d74d71f0c5b69f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 768134
Reviewed-on: https://skia-review.googlesource.com/60684
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-17 19:20:33 +00:00
Brian Salomon
62563deb6b Revert "Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans."
This reverts commit fa2d604a7d.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.
> 
> Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.
> 
> I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.
> 
> 
> Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
> Reviewed-on: https://skia-review.googlesource.com/60081
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I7c4c23aa418da09c9708b28cce64ab58e282dd3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/60683
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-17 19:14:15 +00:00
Chris Dalton
a2ac30da36 Enable CCPR for volatile paths
Enables for volatile paths and when path mask caching is disabled.

Bug: skia:
Change-Id: I644b17f2a4f77a4ddf85265f520599499c0800cf
Reviewed-on: https://skia-review.googlesource.com/60481
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-10-17 18:48:42 +00:00
Robert Phillips
2fb81c04d7 Add unit test for clear bug
Bug: 768134
Change-Id: Ifb5a0eaeb85a8f399204467c22d0845d630d0d3d
Reviewed-on: https://skia-review.googlesource.com/60562
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-17 18:14:52 +00:00
Brian Salomon
fa2d604a7d Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.
Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.

I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.


Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
Reviewed-on: https://skia-review.googlesource.com/60081
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-10-17 17:30:12 +00:00
Chris Dalton
8580d51cd8 Add sk_InstanceID
Bug: skia:
Change-Id: I79b0dce96d9af7632f027afa5317a7725e96cda3
Reviewed-on: https://skia-review.googlesource.com/59861
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-10-17 17:22:32 +00:00
Herb Derby
d4a0fc7383 Use combined three pass code for image blur.
This changes more closely matches the GL output, and the runtimes are similar or
faster for the common cases.

x86_64 times:
benchmark                            old-Us   new-Us   old/new
blur_image_filter_large_80.00_80.00  4842.04  2626.10  1.84381
blur_image_filter_small_80.00_80.00  3297.72  854.97   3.85712
blur_image_filter_large_10.00_10.00  930.44   720.50   1.29138
blur_image_filter_small_10.00_10.00  69.96    42.15    1.65979
blur_image_filter_large_1.00_1.00    682.66   521.78   1.30833
blur_image_filter_small_1.00_1.00    19.21    14.43    1.33125
blur_image_filter_large_0.50_0.50    696.17   64.14    10.8539
blur_image_filter_small_0.50_0.50    16.26    5.02     3.23904

arm64 times:
benchmark                            old-Us    new-Us    old/new
blur_image_filter_large_80.00_80.00  42144.53  14128.42  2.98296
blur_image_filter_small_80.00_80.00  24840.58  4392.58   5.65512
blur_image_filter_large_10.00_10.00  3556.40   3793.70   0.937449
blur_image_filter_small_10.00_10.00  282.53    220.62    1.28062
blur_image_filter_large_1.00_1.00    2502.20   2937.99   0.851671
blur_image_filter_small_1.00_1.00    83.32     81.93     1.01697
blur_image_filter_large_0.50_0.50    5643.80   272.83    20.6861
blur_image_filter_small_0.50_0.50    141.02    38.29     3.68295

Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD
Change-Id: Ic53b3186607d5485477b92e4ca7b092bf1366c52
Reviewed-on: https://skia-review.googlesource.com/52771
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-10-17 16:06:32 +00:00
Robert Phillips
7bbbf62d6e Fix GrContext::writePixels bug
Bug: 769760
Change-Id: I63603c036a8eef5eec66afb6ac4e937f556bbb63
Reviewed-on: https://skia-review.googlesource.com/59681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-17 13:38:12 +00:00
Brian Salomon
d28a79d495 Make GrResourceProvider more sk_spified
Change-Id: If191553093031705756358f4551a5b1e96439742
Reviewed-on: https://skia-review.googlesource.com/60000
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-10-16 17:21:31 +00:00
Mike Reed
f0cb7a09ab Revert "move SkMatrix anonymous affine enum to private"
This reverts commit 708ec81d7a.

Reason for revert: broke android

frameworks/base/core/jni/android/graphics/pdf/PdfEditor.cpp
frameworks/base/core/jni/android/graphics/pdf/PdfEditor.cpp:153:54: error: no member named 'kAScaleX' in 'SkMatrix'; did you mean 'kMScaleX'?
    FS_MATRIX transform = {transformValues[SkMatrix::kAScaleX], transformValues[SkMatrix::kASkewY],
                                           ~~~~~~~~~~^~~~~~~~


Original change's description:
> move SkMatrix anonymous affine enum to private
> 
> enum members aren't used by SkMatrix.h or by
> clients outside of Skia.
> 
> R: reed@google.com, bungeman@google.com
> Bug: skia:6898
> Change-Id: I6873b4106e5ffe354caf5ec18cc613910304fa13
> Reviewed-on: https://skia-review.googlesource.com/59160
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Cary Clark <caryclark@skia.org>

TBR=bungeman@google.com,reed@google.com,caryclark@skia.org

Change-Id: I7fe80879e8b851c9036fc910a314129c299d82d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6898
Reviewed-on: https://skia-review.googlesource.com/59460
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-13 13:26:08 +00:00
Eric Karl
914a36b248 MakeBackendTextureFromSkImage
Creates a static function on SkImage which converts the SkImage to a
GrBackendTexture. The texture is unowned by Skia, and must be deleted
by the caller. Allows for a no-copy / no-conversion fast path if the
provided image is unowned (unique()) and texture backed.

Change-Id: I8a48f9cc39de792725cd72057d98cd1c4594daab
Reviewed-on: https://skia-review.googlesource.com/52440
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Eric Karl <ericrk@chromium.org>
2017-10-12 20:05:31 +00:00
Cary Clark
708ec81d7a move SkMatrix anonymous affine enum to private
enum members aren't used by SkMatrix.h or by
clients outside of Skia.

R: reed@google.com, bungeman@google.com
Bug: skia:6898
Change-Id: I6873b4106e5ffe354caf5ec18cc613910304fa13
Reviewed-on: https://skia-review.googlesource.com/59160
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-10-12 19:56:31 +00:00
Greg Daniel
177e695589 Add flag on GrBackendTexture to say whether texture is mipped or not
Bug: skia:
Change-Id: Ia684e3daf779ec2feaaec64c04dabf5cb03cd07a
Reviewed-on: https://skia-review.googlesource.com/57821
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-12 17:02:41 +00:00
Ethan Nicholas
c9472af858 SkSL FPs now support child processors, converted ArithmeticFP to SkSL
Bug: skia:
Change-Id: I34ed3480073d05762a7d4692aeee4b87e454ce52
Reviewed-on: https://skia-review.googlesource.com/57961
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-10-11 18:05:07 +00:00
nagarajan.n
0ec0bf045e Return error and exit from loop when there is error in compare bitmap test
This patch returns error and exit from loop when there is error in
comparing bitmap test.

Bug: skia:None
Change-Id: If7fe9d8cf6b936bf1fb84de69e73c453a6c253de
Reviewed-on: https://skia-review.googlesource.com/57600
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-10-11 16:51:57 +00:00
Mike Klein
b89c88311d keep SkRSXforms aligned in SkLiteDL
We've been copying the text first, then the transforms.
That's a good way to get the transforms out of alignment.

This CL swaps the order of the two.

Bug: skia:7133

Change-Id: If8cd402b9ffba1787345dc4b5ffd4ee6abb14f33
Reviewed-on: https://skia-review.googlesource.com/57941
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-10-11 13:06:19 +00:00
Herb Derby
5eb1528234 Add mulHi to SkNx
Add mulHi to base SkNx, and specialize implementations for Sk4u for
neon and sse.

Add casts for converting from uint8_t by 4 to uint32_t by 4.

Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Change-Id: I29a32e2ad9812a47fff841ceca334e562362836f
Reviewed-on: https://skia-review.googlesource.com/57960
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2017-10-11 08:21:09 +00:00
Mike Reed
e07622386b clone saturating cast code for doubles
Bug: skia:
Change-Id: I4f35413995cf73c6f130476d6b36e530120aa7ed
Reviewed-on: https://skia-review.googlesource.com/57901
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-10 19:58:13 +00:00
Hal Canary
c5b9498891 SkPDF: consolidate two functions in SkPDFObjNumMap
Change-Id: Id815920e664ba986258867b7c35a7618a6927b0f
Reviewed-on: https://skia-review.googlesource.com/54360
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2017-10-10 16:41:13 +00:00
Ben Wagner
3f98552933 Small pathops cleanup.
Newer clang compiler produces the diagnostic

../../tests/PathOpsDebug.cpp:1349:44:
error: comparison of unsigned enum expression >= 0 is always true
[-Werror,-Wtautological-unsigned-enum-zero-compare]
        if (!firstOp && c->operand() && op >= 0) {

The check seems to be defending against bad values of SkPathOp, but
this now seems unnecessary. This also adds 'rdiff' to kPathOpStr for
future debugging.

Change-Id: I08e5ba77c56e519ce4d9ae89491f7ccd5eb7f944
Reviewed-on: https://skia-review.googlesource.com/57104
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-09 22:01:34 +00:00
Ben Wagner
63fd760a37 Remove trailing whitespace.
Also adds a presubmit to prevent adding trailing whitespace to source
code in the future.

Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6
Reviewed-on: https://skia-review.googlesource.com/57380
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-09 21:20:34 +00:00
Brian Salomon
7f56d3d2d8 Revert "Revert "Disable GL buffer mapping on TSAN/Mac.""
This reverts commit 4e7cdd5a00.

Bug: skia:7058
Change-Id: I3b92c35835cf7a8c04e9218194bf293b790413e0
Reviewed-on: https://skia-review.googlesource.com/57222
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-09 20:24:04 +00:00
Mike Reed
df071d7885 use new computeByteSize api
Bug: skia:
Change-Id: I92ddb7768ace21afa45b3c2b07db556bf42f4f50
Reviewed-on: https://skia-review.googlesource.com/57261
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2017-10-09 17:18:07 +00:00
Ethan Nicholas
abff956455 initClassID no longer auto-allocates ids
Auto-allocated IDs mean that the IDs depend upon the order in which
classes happen to get initialized and are therefore not consistent
from run to run. This change paves the way for a persistent shader
cache by fixing the IDs in an enum.

Bug: skia:
Change-Id: I3e923c6c54f41b3b3eb616458abee83e0909c09f
Reviewed-on: https://skia-review.googlesource.com/56401
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-10-09 15:20:33 +00:00
Brian Salomon
4e7cdd5a00 Revert "Disable GL buffer mapping on TSAN/Mac."
This reverts commit c203e65265.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Disable GL buffer mapping on TSAN/Mac.
> 
> Also reverts 65e7063796 which disabled buffer mapping in GrResourceProvider::createPatternedIndexBuffer.
> 
> Bug: skia:7058
> Change-Id: I6816abe53251e1cd8e92eae41b8cdbe45218a341
> Reviewed-on: https://skia-review.googlesource.com/50100
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=mtklein@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Icf0cf40ba4d6e7081971eee2eea0a41033790df7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7058
Reviewed-on: https://skia-review.googlesource.com/57220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-09 15:18:45 +00:00
Brian Salomon
c203e65265 Disable GL buffer mapping on TSAN/Mac.
Also reverts 65e7063796 which disabled buffer mapping in GrResourceProvider::createPatternedIndexBuffer.

Bug: skia:7058
Change-Id: I6816abe53251e1cd8e92eae41b8cdbe45218a341
Reviewed-on: https://skia-review.googlesource.com/50100
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-09 13:33:54 +00:00
Ben Wagner
67ef5d7640 Remove SkTypeface::Style use in API.
All known callers of SkTypeface::MakeDefault call it with kNormal and
the only users specifying kNormal explicitly are in Skia, so remove the
parameter. There appear to be no users of SkTypeface::MakeFromTypeface,
so remove it. The current alternative is SkFontMgr::matchFaceStyle which
can do a better job anyway.

Change-Id: I89d94c77f9593407b0a319786848a8b823fcbae4
Reviewed-on: https://skia-review.googlesource.com/56762
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-09 03:13:33 +00:00
Chris Dalton
cc604e5e9e CCPR: Add workaround for PowerVR crash
Bug: skia:
Change-Id: Icd00f81fda5366813f9c959fdc91b0415894cbfc
Reviewed-on: https://skia-review.googlesource.com/55360
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-10-06 22:48:59 +00:00
Greg Daniel
e1da1d9a7d Add option to create a deferred render target context with mips
We need this since we have texture generators that draw the base level
but nothing more. Thus we want them to be able to directly draw into
a pre allocated mipped target instead of doing a copy later.

TBR: bsalomon@google.com
Bug: skia:
Change-Id: I1dfae0da7153b21b30fdfa51a7061fc255739a1e
Reviewed-on: https://skia-review.googlesource.com/54100
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-06 20:28:00 +00:00
Chris Dalton
f1b47bb299 Add a cap for geometry shader invocations
Bug: skia:7116
Change-Id: I3cc2ce7b2e5123c9adfd9781b2a5a8553747dfa5
Reviewed-on: https://skia-review.googlesource.com/56000
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-10-06 18:43:06 +00:00
Chris Dalton
1265894423 Don't execute onFlush op lists until after GPU data is uploaded
Bug: skia:
Change-Id: Ide85e802fd6e6a19412457dbaded3545b962c240
Reviewed-on: https://skia-review.googlesource.com/55562
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-10-06 16:04:14 +00:00
Cary Clark
583dd2bbc0 add constexpr to SkRect, SkIRect Make functions
Also, doing so exposed a couple of unused
variables in tests.

R: bsalomon@google.com
Bug: skia: 6898
Change-Id: I7b065e26a838fe55a1d772bcefaef5325e1baa61
Reviewed-on: https://skia-review.googlesource.com/55680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-10-05 16:55:34 +00:00
Brian Osman
b379dcd64e Sever fOriginalPath connection whenever a GrShape becomes a simple type
When drawing a round-rect, for example, we may end up in drawPath with a
temporary path that was created with the rrect added. We ended up putting
a genID listener on that (stack allocated) path, so we would evict cache
entries immediately. This restores the old behavior, where cache entries
for paths derived from simple types are never invalidated.

Bug: skia:7087
Change-Id: I3eed9c3a289241bfe1e42036be3362f592256693
Reviewed-on: https://skia-review.googlesource.com/54460
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-04 20:30:03 +00:00
Brian Osman
5fcd3913da Fix path renderer cache test logic to account for other resources
Bug: skia:
Change-Id: Iadf88cc07fac23544317166699138644218b38d1
Reviewed-on: https://skia-review.googlesource.com/55141
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-04 19:10:12 +00:00
Robert Phillips
fa8c080449 Use SK_DISABLE_DEFERRED_PROXIES to only disable deferred proxies for Chrome
This relies on https://chromium-review.googlesource.com/c/chromium/src/+/700475 (Readd SK_DISABLE_DEFERRED_PROXIES flag) landing in Chrome first.

It refines the changes made in: https://skia-review.googlesource.com/c/skia/+/54004 (Temporarily disable deferred texture proxies)

Change-Id: I12af50349516d32f74cd7f7dfd25a668284f64fa
Reviewed-on: https://skia-review.googlesource.com/55100
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-04 15:42:22 +00:00
Greg Daniel
c42b20b832 Revert "Revert "When flushing, reset flush state before op lists""
This reverts commit f8bc0018be.

Reason for revert: disabling failing test

Original change's description:
> Revert "When flushing, reset flush state before op lists"
> 
> This reverts commit 78bdee200c.
> 
> Reason for revert: breaking PathRendererCacheTests.cpp unit test
> 
> Original change's description:
> > When flushing, reset flush state before op lists
> > 
> > When we reset the flush state after executing the ops in a flush, we reset
> > the stored pipelines which may be holding refs to resources in their processors.
> > 
> > We want the resources that we wrote to in the op list to be freed last for caching
> > LRU purposes. Thus we make sure to free all the pipeline resources first before
> > resetting and freeing the op lists
> > 
> > Bug: skia:
> > Change-Id: I5b02e9b7532007b5854e906bf4d64e901e7e7e53
> > Reviewed-on: https://skia-review.googlesource.com/54760
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,robertphillips@google.com
> 
> Change-Id: If74a158e90316553a401386c8c7a6b3c2b29a7df
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/55080
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,robertphillips@google.com

Bug: skia:
Change-Id: Ibdfe37c1f9e54956bf1725d1d7474a69efcd7673
Reviewed-on: https://skia-review.googlesource.com/55102
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-04 15:03:33 +00:00
Mike Reed
f0ffb8943b Revert[4] "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
This reverts commit 5a2e50edc5.

Bug: skia:
Change-Id: I8d28b5c07d90130e5a1653923740eaf189ecb954
Reviewed-on: https://skia-review.googlesource.com/53900
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-03 20:03:35 +00:00
Ben Wagner
af89366cb8 Make SkString reference counting thread/TSAN safe.
BUG=skia:7107

Change-Id: I8ead98f7694faaed8e6f6f29b1fcd88501d36b66
Reviewed-on: https://skia-review.googlesource.com/54400
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-10-03 18:34:35 +00:00
Brian Osman
7ea46bf9d9 Remove test suppresion for ANGLE GLPrograms test
The NaN shader literal bug has been worked around, so lets get this test
coverage back.

Bug: skia:6842
Change-Id: I7b6b00972d9e00e49e5f2eccac9f2eda7fffbb6c
Reviewed-on: https://skia-review.googlesource.com/54362
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-03 17:42:05 +00:00
Robert Phillips
73f7e1dbdd Temporarily disable deferred texture proxies
Bug: 769760
Change-Id: Id4197a73737f3a8df9159d9eb081be094df1f731
Reviewed-on: https://skia-review.googlesource.com/54004
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-10-02 18:25:44 +00:00
Mike Reed
5a2e50edc5 Revert "Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"""
This reverts commit cd284c5323.

Reason for revert:

assert fired in SkMallocPixelRef.cpp:61: fatal error: "assert(info.computeByteSize(rowBytes) == info.getSafeSize(rowBytes))"

google3 thinks it was from surface_rowbytes

Original change's description:
> Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap""
> 
> This reverts commit 809cbedd4b.
> 
> Bug: skia:
> Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d
> Reviewed-on: https://skia-review.googlesource.com/52665
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I41e3f7a3f791cc8183291847e783ed8a53bc91d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/53802
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-02 13:44:18 +00:00
Mike Reed
cd284c5323 Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap""
This reverts commit 809cbedd4b.

Bug: skia:
Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d
Reviewed-on: https://skia-review.googlesource.com/52665
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-10-02 12:55:37 +00:00
Robert Phillips
3ec9573ac3 Add unit test for pinned SkImages
Change-Id: I2e14353bc865b5994cc90ad643a6a58604955957
Reviewed-on: https://skia-review.googlesource.com/53500
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-09-29 20:04:54 +00:00
Leon Scroggins III
4cdbf6056d Avoid uninitialized memory in readByteArrayAsData
Bug: 769134

readByteArray can fail (due to not having enough available or due to the
wrong alignment). If it does, do not return an uninitialized block of
memory.

Further, drop the initial size check, which is covered by readByteArray.

Add a test.

Change-Id: Ia101697c5bb1ca3ae3df1795f37a74b2f602797d
Reviewed-on: https://skia-review.googlesource.com/52742
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-09-28 19:51:32 +00:00
Chris Dalton
29011a2bda Remove tolerance form SkClassifyCubic
It's too inexact as-is. If the caller wants tolerance they can do
their own with knowledge of the pixel grid. The homogeneous math
is stable with infinities so it's really unnecessary here.

Bug: skia:7073
Change-Id: I4dc34ad96b859a138714b6d4f8804fec4f89f17a
Reviewed-on: https://skia-review.googlesource.com/51182
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-09-28 18:39:58 +00:00
Jim Van Verth
809cbedd4b Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
This reverts commit 88757dacd4.

Reason for revert: Still seems to be failing Chromium "telemetry_perf_unittests (with patch) on Android" on android_n5x_swarming_rel.

Original change's description:
> guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
> 
> Now with legacy behavior for allocpixels
> 
> This was reverted, so the current CL is a "fix" on top of ...
> https://skia-review.googlesource.com/c/skia/+/50980
> 
> Related update to Chrome (in preparation for this change)
> https://chromium-review.googlesource.com/c/chromium/src/+/685719
> 
> Bug: skia:
> Change-Id: I4b370ee7e95083ab27421f008132219c9c7b86e9
> Reviewed-on: https://skia-review.googlesource.com/51341
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I827a0ca1d1e3909e648fde3342cdb8601d34da8d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/52381
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-09-27 23:15:07 +00:00
Chris Blume
0b5e7d16c2 Treat invalid indices as transparent in gifs
Other browsers (including old Chrome) treat invalid palette indices as
transparent for gifs. And there are gifs in the wild which rely on this.

As an example, if the palette only has 64 entries (0-63) then index 64
is treated as transparent.

BUG=skia:7069

Change-Id: I15e8919a953387506c9ac5945c3ae6a2b90189ab
Reviewed-on: https://skia-review.googlesource.com/51100
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Chris Blume <cblume@google.com>
2017-09-27 21:03:41 +00:00
Leon Scroggins III
e56774602c Fix truncated webp images
Bug: b/65290323

If a webp file is truncated such that no rows can be decoded,
WebPIDecGetRGB does not initialize its "last_y" parameter. We use
rowsDecoded (passed as last_y) to determine which remaining rows to
fill.

Check the return value of WebPIDecGetRGB. If it fails (returns null),
or rowsDecoded is <= 0 (matching Chromium's check), return
kInvalidInput, since there is nothing to draw.

Note that this is a change in behavior for Android. Previously we
would decode an empty webp to just a transparent/black rectangle,
whereas now we simply fail. I think this is a change for the better.

Add a test which truncates a file to have 0 rows available and attempts
to decode it. msan verifies that we no longer depend on the
uninitialized value.

Stop attempting to test decoding subsets from an incomplete webp (in
CodecTest.cpp). Unless we have decoded the portion covered by the
subset, this will fail.

Remove test images inc0.webp (from both dm/ and colorspace/) and
inc1.webp. These just decode to transparent rectangles. Replace them
with inc2.webp and inc3.webp, which decode part of the image and then
have to fill with transparent.

Change-Id: I64d40be91c574b45963f9a43d8dd8f4929dd2939
Reviewed-on: https://skia-review.googlesource.com/50303
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: James Zern <jzern@google.com>
2017-09-27 20:51:02 +00:00
Brian Osman
28c434b807 Handle instantiation of proxies with pending invalidation messages
Bug: skia:
Change-Id: Id6808734df2335c521d4a563122ceeca906b7601
Reviewed-on: https://skia-review.googlesource.com/52002
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-27 17:38:38 +00:00