Commit Graph

10066 Commits

Author SHA1 Message Date
Brian Salomon
6066b754fe Remove cheap/any texture distinction from SkImageGenerator.
With the removal of rescaling of NPOT textures this no longer matters.

Change-Id: I313e895407c3a2c616e6113a5bde75dc6a167e7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273519
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
2020-02-27 13:58:17 +00:00
Jim Van Verth
8ec13300cd Fill in more D3DCaps
Bug: skia:9935
Change-Id: Id8b851afdd97f8405dbb405e3f142f86dbe1de31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273003
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-02-26 18:26:45 +00:00
Mike Reed
8989363322 rm unneeded header, see include/public
Change-Id: Ica26f683a9fd0ef7a624aa081678b619b70c9af8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273400
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-26 04:53:33 +00:00
Julia Lavrova
9b906ce536 Revert "remove private copy of SkM44.h"
This reverts commit f8ef81b35e.

Reason for revert: Build broken

Original change's description:
> remove private copy of SkM44.h
> 
> Change-Id: Ifd47b929bafd40d190722366a0c1e2b856220ab3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272836
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I0da4ad43d5eaf5813ec489bc9117d4b8fc2b930e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273330
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-02-25 23:00:54 +00:00
Brian Salomon
d8575452eb Add GrContextOption for GL error checking, shader, and program success.
Small behavior change: will not check for shader success and program
linking success over the command buffer in a debug build.

Also fail gracefully if stencil renderbuffer allocation fails.

Bug: skia:9938
Bug: chromium:1040186
Change-Id: I623f09d306261d28070078268f6242f92d65fd5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273276
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-02-25 21:00:19 +00:00
Mike Reed
f8ef81b35e remove private copy of SkM44.h
Change-Id: Ifd47b929bafd40d190722366a0c1e2b856220ab3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272836
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-25 19:51:17 +00:00
Brian Salomon
9f00494951 Add test that SWPathRenderer GenIDChange listeners get removed.
When a cached path mask texture is destroyed it should remove the
gen ID change listener on from the SkPathRef:
https://skia-review.googlesource.com/c/skia/+/272654

Change-Id: I4d1781e578b29b801b1b5b97ba5119ac321de73c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273004
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-02-25 14:51:51 +00:00
Shachar Langbeheim
c43a6c54b1 Remove docs for macros that don't exist in the code.
Change-Id: Ibabe3f1f9663ec36b5128bdb6f1cfeb7b8e09e8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272896
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-02-24 19:44:45 +00:00
Robert Phillips
251ee1da5b Remove SkDDLTmpRedirect.h
With the Chrome-side CL:

https://chromium-review.googlesource.com/c/chromium/src/+/2067805 (Switch SkDDLTmpRedirect.h reference to SkDeferredDisplayList.h)

having landed, Skia no longer needs this temporary header.

TBR=bsalomon@google.com
Change-Id: I01da4ece2be239407e223105781d4d0d75deabdb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273018
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-24 18:26:35 +00:00
Dominic Mazzoni
2a016bad67 Allow passing multiple node IDs per PDF structure node.
At the time Chromium is painting, we're passing node IDs
along with painting commands to enable tagging. However,
this assumes that all nodes will end up in the structure
tree, which we might not want.

Instead, allow the client to prune the structure tree
later before telling Skia to generate the PDF, but
keep all of the node IDs to be matched up with.

As an example, suppose the doc looks like this:

root id=1
  paragraph id=2
    div id=3
      text1 id=4
    link id=5
      text2 id=6

The pruned tree passed to Skia would look like this:

root id=1
  paragraph id=2 extra_ids=3,4
    link id=5 extra_ids=6

We need to pass the extra node IDs into Skia so
that when content is tagged with id=4, we know to
map that to the paragraph node with id=2 instead.

Note that the resulting PDF document will *not*
have any of these extra IDs, they're all remapped
and consolidated.

While it's not strictly necessary that this is done
in Skia, it's easiest to implement it here. Doing the
same upstream would require replaying an SkPicture
and rewriting all of the node IDs.

Bug: chromium:607777
Change-Id: I0ecb62651e60b84cc5b9d053d7f7d3b9efda1470
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272462
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
2020-02-24 18:21:16 +00:00
Jim Van Verth
03b8ab225f Reland "Create D3D device and queue"
This is a reland of 29dc430f43

Original change's description:
> Create D3D device and queue
> 
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

Bug: skia:9935
Change-Id: I1c8797e09cdeb3694ea7f47b2236ab7d91d9519f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272996
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-02-24 17:41:55 +00:00
Robert Phillips
1cec4d5e3d Add a program iterator to SkDeferredDisplayList
Bug: skia:9455
Change-Id: I201218174b5d6efb72f7c06766a49f6711325bd5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272530
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-24 14:03:06 +00:00
Leandro Lovisolo
16656fc96c Revert "Create D3D device and queue"
This reverts commit 29dc430f43.

Reason for revert: This is breaking the Google3 autoroller due to header file d3d12.h not being available on google3.

Original change's description:
> Create D3D device and queue
> 
> Bug: skia:9935
> Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: I3857444cae52cc2338258c46b974ae5496bbaedc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272726
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
2020-02-21 22:49:12 +00:00
Robert Phillips
4d5594dff1 Move SkDeferredDisplayList.h into include\core (take 2)
Clients will need official access to this class for the compilation iterator.

This CL also hides some of the cruft we don't want exposed.

Bug: skia:9455
Change-Id: I696c058f1c409fb459229552fbbdd935ec112358
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272643
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-21 21:26:02 +00:00
Florin Malita
178b860769 [skottie] Initial support for per-character 3D
When per-character 3D is enabled, text properties can be animated in
3 dimensions.

 - position and scale become 3-value vectors
 - in addition to existing "r" (really rz), rotation gains "rx" and "ry"
 - instead of specializing for 3D, expand the existing structures to
   handle both 3D and 2D modes
 - also ensure that sksg::Transform does not flatten to SkMatrix

Change-Id: I426a7ee1ff38c1702deb85e9f1db80f6069f36d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272648
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-02-21 21:14:02 +00:00
Mike Reed
82260fc756 remove unneeded include
Change-Id: Ie3c08d79ae36f28ff48f825699a2542154ca3096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272652
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-21 21:01:32 +00:00
Brian Osman
6fa47769cb In SkRuntimeEffect, use a single shared Compiler instance
I've been increasingly concerned about the CPU and memory costs of
creating and holding on to many Compiler instances. Given that they're
use infrequently, having a shared (guarded) instance seems fine.

We can still look at reducing the startup cost of a single instance, but
this removes a large blocker to wider usage of SkRuntimeEffect.

Change-Id: Ia6dc721c73fdf8c9c4c7a8c1af5f350d2c028b22
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272466
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-02-21 20:25:04 +00:00
Jim Van Verth
29dc430f43 Create D3D device and queue
Bug: skia:9935
Change-Id: Ib6548f413ca3a8befb553d2d47354b400c9162b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272520
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-02-21 19:49:52 +00:00
Robert Phillips
305033b6e8 Revert "Move SkDeferredDisplayList.h into include\core"
This reverts commit ad3b2c9886.

Reason for revert: clang

Original change's description:
> Move SkDeferredDisplayList.h into include\core
> 
> Clients will need official access to this class for the compilation iterator.
> 
> This CL also hides some of the cruft we don't want exposed.
> 
> Bug: skia:9455
> Change-Id: I408c19f9ecd6880a5a7853def591407b0ca43e4e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272343
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ica80434e7423fb202355eb77a614ece1c4d54726
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9455
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272641
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-21 18:38:31 +00:00
Robert Phillips
ad3b2c9886 Move SkDeferredDisplayList.h into include\core
Clients will need official access to this class for the compilation iterator.

This CL also hides some of the cruft we don't want exposed.

Bug: skia:9455
Change-Id: I408c19f9ecd6880a5a7853def591407b0ca43e4e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272343
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-21 18:23:11 +00:00
Mike Reed
415caceb11 adopt new name convention
Change-Id: I7dedf2c8724256cf6889d8a608b425cb9188c030
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272597
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-21 17:28:42 +00:00
Mike Reed
46f5c5f08b Make SkM44 public
Need to migrate clients from private/ to core/ include
Unexperimentalize concat44() methods on SkCanvas

Change-Id: I64b8816722a9d93316cb8b8691d2d9a3e36f167f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272464
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-21 15:50:31 +00:00
Dominic Mazzoni
6ffabbb4c4 Simplify interface to StructureElementNode.
Use a std::vector of std::unique_ptr for the children, rather than an
error-prone raw pointer.

Use a string for the element type, rather than an enum.

In both cases, both the old and new format are supported and tested
within Skia until Chromium has migrated.

Also add support for Alt and Lang, which are like attributes
but go right on the structure node. There are only a small
handful of attributes that go on the structure node so this
seems like the simplest solution.

Bug: chromium:607777
Change-Id: I4f315685df35dd9dcd8e1bca6d275cbeb8f2c67a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271816
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
2020-02-20 21:16:48 +00:00
Robert Phillips
ca85b9b8e3 Add temporary header to shift clients over to include/core/SkDeferredDisplayList.h
The plan is:
Add SkDDLTmpRedirect.h
update clients to point to SkDDLTmpRedirect.h
Move SkDeferredDisplayList.h to include/core (and update SkDDLTmpRedirect.h)
update clients to point to SkDeferredDisplayList.h in its new location
remove SkDDLTmpRedirect.h

This staging is required to land:

https://skia-review.googlesource.com/c/skia/+/272343 (Move SkDeferredDisplayList.h into include\core)

Change-Id: I3302cdb8607b259d084bb9dd00600652c7f9a93a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-20 20:12:38 +00:00
Mike Reed
9d4e31d6cd rm Sk3D.h -- long live SkMat4
Change-Id: Ib83ee6567b1a32f34364b7ac66a659eaeced3249
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272037
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-20 13:15:33 +00:00
Mike Reed
e1a81bad5f move SkVec2 into shared header
Change-Id: I2b39242fe0519fa188151974dea883bad5652eb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272118
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-19 23:27:04 +00:00
Dominic Mazzoni
7dfb46e7f3 Re-land: Support adding attributes to PDF document structure nodes.
Originally landed: https://skia-review.googlesource.com/c/skia/+/268878
Reverted: https://skia-review.googlesource.com/c/skia/+/271858

The issue was with compilation when PDF support is disabled. See
the diff between patchsets 1 and 2.

This is an important part of writing a tagged PDF. Many of the nodes
in the document structure tree need additional attributes, just like
in HTML.

This change aims to add support for a few useful attributes, not to
be comprehensive.

Bug: chromium:1039816
Change-Id: I15f8b6c41d4fdaa4b6e21775ab6d26ec57eb0f5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271916
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2020-02-19 20:50:14 +00:00
Mike Klein
28abea51fa dip our toes into c++11 style [[attributes]]
AFAIK, we can replace a lot of preprocessor tests now that we have
[[attributes]] and compilers are supposed to ignore unknown attributes.
Let's see if it works. If this sticks I'll get the rest in a big CL.

-Wattributes and MSVC warning C5030 are kind of annoying as errors,
so turn them off.  This does not bode well for rolling into clients.

Change-Id: I88b150bab746c5510ff94f604096bf0ee0c9f96a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271886
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-02-19 17:51:40 +00:00
Chris Dalton
5a5fe79ebf Improve the mechanism to suppress warning messages during testing
It's important to suppress warning messages during tests that
intentionally trigger them, in order to not confuse users. This CL
attempts to make the suppression mechanism more general, and then
suppresses another warning that has started coming out in dm.

Bug=skia:9927
Change-Id: I67b5bcd1865f4001964bbdc967b0327682b4258b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271177
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-02-19 16:34:09 +00:00
Brian Osman
d3b3bf3567 Reland "Move runtime shader/colorfilter into SkRuntimeEffect.cpp"
This reverts commit 7281a86237.

Change-Id: I1759358ede39e2466362cc4d3f0b9530eff08c9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271656
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-02-19 15:29:09 +00:00
Mike Reed
86b4388fdc Revert "Support adding attributes to PDF document structure nodes."
This reverts commit 80474156d1.

Reason for revert: breaking chrome roll

https://ci.chromium.org/p/chromium/builders/try/cast_shell_linux/533554

Original change's description:
> Support adding attributes to PDF document structure nodes.
> 
> This is an important part of writing a tagged PDF. Many of the nodes
> in the document structure tree need additional attributes, just like
> in HTML.
> 
> This change aims to add support for a few useful attributes, not to
> be comprehensive.
> 
> Bug: chromium:1039816
> 
> Change-Id: I64a6b36b0b4ec42fd27ae4ad702afce95c95af5d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268878
> Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Dominic Mazzoni <dmazzoni@chromium.org>
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,reed@google.com,dmazzoni@chromium.org,dmazzoni@google.com

Change-Id: Iedd397303e870144e8d282db0cb81c535a783e8b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1039816
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271858
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-19 14:23:31 +00:00
Robert Phillips
f6a0b45414 Store ProgramDesc on DDLs alongside the GrProgramInfo
We already have the program desc bc we uniquify the programs stored
on the DDL. This CL just preserves them on the snapped DDL to speed
up precompilation.

Bug: skia:9455
Change-Id: Ie0e0b607e2e96beca7128f4083386b34ad469072
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270998
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-02-18 20:35:55 +00:00
Jim Van Verth
b01e12b716 Start adding D3D backend
Bug: skia:
Change-Id: Id24ed653adb80fe9b2ad597a34e459eb91ca53ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271057
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-18 20:14:15 +00:00
Brian Osman
7281a86237 Revert "Move runtime shader/colorfilter into SkRuntimeEffect.cpp"
This reverts commit 8980acd623.

Reason for revert: Win-Shared

Original change's description:
> Move runtime shader/colorfilter into SkRuntimeEffect.cpp
> 
> Better organization that lets us share a bunch of code between these
> (very similar) objects.
> 
> Change-Id: Ie559d6e144d8588b98a95d4170e2e6c19d9623bd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270736
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,reed@google.com

Change-Id: Ic13d85b7c4f2d593a6c15dde067f118ea5753eb6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271600
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-02-18 19:31:14 +00:00
Brian Osman
8980acd623 Move runtime shader/colorfilter into SkRuntimeEffect.cpp
Better organization that lets us share a bunch of code between these
(very similar) objects.

Change-Id: Ie559d6e144d8588b98a95d4170e2e6c19d9623bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270736
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-02-18 19:15:05 +00:00
Dominic Mazzoni
80474156d1 Support adding attributes to PDF document structure nodes.
This is an important part of writing a tagged PDF. Many of the nodes
in the document structure tree need additional attributes, just like
in HTML.

This change aims to add support for a few useful attributes, not to
be comprehensive.

Bug: chromium:1039816

Change-Id: I64a6b36b0b4ec42fd27ae4ad702afce95c95af5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268878
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-02-18 18:14:36 +00:00
Yi Xu
55bca410f9 Update SkSurface::ReplaceBackendTexture to take ContentChangeMode
In SkSurface::ReplaceBackendTexture, it used to always retain a copy
of the the current content. The ContentChangeMode is added as a
parameter to allow the callers to decide whether retain or discard the
current content.

Bug: 1014246

Change-Id: I8736e7795b4755bbde94009ffe4d943c75112b98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271016
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
2020-02-18 15:15:06 +00:00
Mike Reed
4d1700125c move SkDeque.h into private
Perhaps just make this SkTStack...

Change-Id: Iefdbb1e33acec96aec5f885e3e16ac2d97fd5f73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271320
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-18 02:05:08 +00:00
Mike Reed
706f6b4069 test data.equals with empty
Change-Id: Ib79fb2ba099a0d094ab16b1d7307c03e64b1fd1f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271240
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-02-17 17:53:49 +00:00
Mike Reed
2c5ee18724 remove legacy factory for overdrawcolorfilter
Change-Id: I19453c51bf275050d6426b82a1ad717348a3ea56
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271136
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-15 16:53:39 +00:00
Mike Reed
528998dfd5 Fix impl for OverdrawColorFilter to not rely on details of pmcolor,
esp. during serialization. We now store/serialize SkColor, which is
stable.

Change-Id: Ib453920a9a06647f44b33c9ae8af33936d6ead33
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270997
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-14 18:38:18 +00:00
Brian Salomon
64f4206fe9 Remove unique_ptr_address_as_pointer_address
std::unique_ptr is not always the same size as a pointer (shame! shame!).
AFAICT I added this terrible hack just to be able to make GrProcessorSet
store unique_ptrs of const GrFP rather than non-const FP, which is in no
way important.

Bug: skia:9908

Change-Id: I6e7eb0c0a7ad3473489e549909fa0b0a9eeec49b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270938
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-02-14 16:09:28 +00:00
Robert Phillips
b3c061aa4f Add createBackendFormat and createFBO0 helper methods to SkSurfaceCharacterization
These make it easier for clients to create new surface characterizations that differ only a little from an existing surface characterization.

Change-Id: Iebd0b32ae941d3f91427927108d092cb5864b09f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270444
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-13 18:55:22 +00:00
Ben Wagner
d38f00a12a Skip degenerate contours in glyphs.
Stroking in Skia follows the SVG rules of adding end caps to degenerate
contours. Skip all degenerate contours and degenerate curves on contours
to avoid this.

Bug: skia:9820
Change-Id: I320beeeb3728f39c764729454dcb128a05524d35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268166
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-02-13 16:22:42 +00:00
Mike Klein
508fd32091 make SkBBH a public interface
I don't necessarily like this long term, but in the short term Flutter
would like to record pictures using their own type separate from
SkRTree.  This makes SkBBoxHierarchy public, and converts it to use
other public types (SkTDArray -> vector).

Change-Id: I29c5ef9da7d641d8f4ba18522b168ddf7cefe84f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270387
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-02-12 16:31:05 +00:00
Mike Klein
f7eb0544a8 basic, untested BGR 1010102 and 101010x
Updated every switch that yelled at me, and added support to dm and fm,
and then founds some more switches that shouldn't have defaults...

The tricky spots outside those were mips and dither,
since they aren't simply exhaustive switches.

_Now_ no diffs between RGB/BGR 1010102 and 101010x.

No GPU support.

Bug: skia:9893
Change-Id: I73ab3fd22bdef0519296dfe4cb84031e23ca0be3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270114
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-11 21:44:57 +00:00
Mike Klein
1cb5527bc6 remove enum docs
These docs repeat the possible values for these enums at
the time they were written ad nauseum.  They're not kept
up to date.

This is the result of searching for "one of" and deleting most.
I did keep one set of docs where some enum values were permitted
on some platforms and others on others.  And I kept docs for args
that didn't take enums but only accepted a particular range, like
[0,8] for matrix value indices or 0-4 for pixel size shifts.

Change-Id: Ib21ec54ebbc4abe456e9b3f436f3823d7da9097d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270107
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-02-11 21:43:07 +00:00
herb
660317f6a7 Move scaler context fallback to GDI
The GDI Typeface is the only one that can fail to make a
scaler context. Move all the logic to the GDI specific code.

Change-Id: I50a0a58529bb44625068244e6ae27e54bccd9f67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269913
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-02-11 19:50:27 +00:00
Brian Osman
f989aeaa01 Support children in SkRuntimeEffect::makeColorFilter
Change-Id: Icf8c69464a44341a08df16dce53aebedc2826bfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270064
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-02-11 16:20:07 +00:00
Brian Osman
d0b3d9ca17 Add comment to SkTPin explaining NaN behavior
Change-Id: Ifaf86ce24dcc8843172761f4e210b0df6f83d32d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270062
Reviewed-by: Mike Reed <reed@google.com>
2020-02-11 14:43:39 +00:00