Commit Graph

8393 Commits

Author SHA1 Message Date
Ben Wagner
761df7534f Remove SkString fwd decl from SkTypes.h.
Remaining users depending on this seem to be cleaned up, so remove this.

Change-Id: I26003831f1c84b0caf9379cbd0952833640db432
Reviewed-on: https://skia-review.googlesource.com/134602
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-06-13 19:14:16 +00:00
Mike Klein
e4b900bfd9 Revert "simplify SkTFitsIn, try 2"
This reverts commit 009f51e43f.

Reason for revert: unintentional header consequences in Chromium... will reland after fixing Chromium

Original change's description:
> simplify SkTFitsIn, try 2
> 
> Originally we wrote this in C++14 constexpr,
> but because this is used from public headers, we can't use
> C++14 yet.  Now a somewhat sillier looking C++11 version.
> 
> All the old tests still pass, and one new added.
> Updated the comments a bit for correctness and readability.
> 
> Change-Id: I99c01e1346c1a5a36278cc08f30538112e5259aa
> Reviewed-on: https://skia-review.googlesource.com/134425
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Auto-Submit: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Ic73f8800bd022ffea125b3b1bf138fe49c0db926
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/134621
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-06-13 18:57:06 +00:00
Mike Klein
a2bf58515a Revert "use std::enable_if instead of assert()"
This reverts commit c6530d1e5e.

Reason for revert: going to revert SkTFitsIn refactor temporarily

Original change's description:
> use std::enable_if instead of assert()
> 
> Crazy?  Genius?
> 
> Change-Id: I6033ab5f1af1a6bee84c27025b988e1143d59293
> Reviewed-on: https://skia-review.googlesource.com/134512
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Auto-Submit: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Id7c91e3a12756defe194379579cc5fd88fd4b164
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/134620
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-06-13 18:56:07 +00:00
Greg Daniel
da86e2822a Remove unused code that was used for late mip allocations.
This also includes removing code to support changing GrGpuResource's size
since we now have to way to ever change the size.

Bug: skia:
Change-Id: Id27a8bc3cc94f5b954beda528b209727ede10ef6
Reviewed-on: https://skia-review.googlesource.com/134503
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-13 18:06:56 +00:00
Cary Clark
1e447dfb77 minor fixes to SkRRect
Move methods that are not publicly callable
to SkRRectPriv.h. Name params, add a trailing
comma to the enum list.

R=reed@google.com,bsalomon@google.com
Bug: skia:6898
Change-Id: If93f712656dde563567a647624e58ce9a9d74494
Reviewed-on: https://skia-review.googlesource.com/134423
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-06-13 17:21:16 +00:00
Mike Klein
c6530d1e5e use std::enable_if instead of assert()
Crazy?  Genius?

Change-Id: I6033ab5f1af1a6bee84c27025b988e1143d59293
Reviewed-on: https://skia-review.googlesource.com/134512
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-13 16:23:46 +00:00
Ben Wagner
6fbafc0afa Remove SkMulDiv.
This removes the last use of SkMulDiv. This last use was in the
conversion code for FontConfig widths and weights which is modified to
use SkScaler instead of SkFixed.

Change-Id: Ia20a2066cbc42e986c44fc573829edf86973846e
Reviewed-on: https://skia-review.googlesource.com/134426
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-06-13 15:41:57 +00:00
Greg Daniel
5f4b09d523 Allow caller to specify if the want mip maps in makeTextureImage call.
Since Ganesh no longer will allocate mips late, this gives the clients a
way to tell skia that they want the texture they will be using to have mips.
It also supports allowing a client to take a non mipped texture backed
image and turn it into a new image which is mipped and texture backed.

Bug: chromium:834837
Change-Id: I1781ce618c22023b6309f248e7ee49e69bd3c6df
Reviewed-on: https://skia-review.googlesource.com/134323
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Eric Karl <ericrk@chromium.org>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-13 13:55:56 +00:00
Mike Klein
009f51e43f simplify SkTFitsIn, try 2
Originally we wrote this in C++14 constexpr,
but because this is used from public headers, we can't use
C++14 yet.  Now a somewhat sillier looking C++11 version.

All the old tests still pass, and one new added.
Updated the comments a bit for correctness and readability.

Change-Id: I99c01e1346c1a5a36278cc08f30538112e5259aa
Reviewed-on: https://skia-review.googlesource.com/134425
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-13 13:50:51 +00:00
Hal Canary
fdcfb8b7c2 Revert "SkTypes: extract SkTo"
This reverts commit 2a2f675926.

Reason for revert: this appears to be what is holding up the Chrome roll.

Original change's description:
> SkTypes: extract SkTo
>
> Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
> Reviewed-on: https://skia-review.googlesource.com/133620
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,halcanary@google.com

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae
Reviewed-on: https://skia-review.googlesource.com/134504
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-13 13:45:47 +00:00
Hal Canary
bb9ee9b4aa SkTypes: add static back
Change-Id: I0791181914c2f52ea97321bc17855f8b212c33d1
Reviewed-on: https://skia-review.googlesource.com/134422
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-12 21:37:54 +00:00
Ben Wagner
cee46e5e99 Remove SkBool8.
This typedef was created at a time when compilers often used sizeof(int)
storage for a bool. This is no longer the case and in all compilers
currently supported 'sizeof(bool) == 1'. Removing this also revealed one
field which was actually not a bool but a tri-state enum.

Change-Id: I9240ba457335ee3eff094d6d3f2520c1adf16960
Reviewed-on: https://skia-review.googlesource.com/134420
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-06-12 21:30:24 +00:00
Mike Klein
2652223767 Revert "simplify SkTFitsIn"
This reverts commit b82c3d6ff2.

Reason for revert: SkTFitsIn makes its way into public headers via SkTo<T>, so it cannot use C++14isms.

Original change's description:
> simplify SkTFitsIn
> 
> Now that we're C++14, a constexpr SkTFitsIn() is a lot easier.
> All the old tests still pass, and one new added.
> 
> Updated the comments a bit for correctness and readability.
> 
> Change-Id: I0f60e32e545fe4f2fb14e66a2bf25d562dbd680f
> Reviewed-on: https://skia-review.googlesource.com/133831
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>

TBR=mtklein@chromium.org,halcanary@google.com,bungeman@google.com

Change-Id: Icfb19c77b450cf3525d11225d4237f9bfa68c7fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/134440
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-06-12 21:07:54 +00:00
Hal Canary
50dbc0949f SkTypes: more into SkMacros
Change-Id: I4c9a2d81a1bc4ccebc78eea56c0de116b98d415e
Reviewed-on: https://skia-review.googlesource.com/134330
Commit-Queue: Hal Canary <halcanary@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-12 20:24:43 +00:00
Hal Canary
bc718c1e9c SkTypes: templates are usually better than macros
Change-Id: If55797642e839154ca06d09c991257031e1d319e
Reviewed-on: https://skia-review.googlesource.com/134331
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-12 19:31:04 +00:00
Hal Canary
22be4c4801 SkMacros split from SkTypes.h
Change-Id: I383719ee181c6925ebf62ffc70e1c0f12ee7cf84
Reviewed-on: https://skia-review.googlesource.com/134326
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-12 18:39:33 +00:00
Mike Klein
22ce79400d remove __cplusplus guard
The file cannot be used as a C header anyway.

Change-Id: Ic33341fce894e48fb0a50b8c7a14c32b59dc9223
Reviewed-on: https://skia-review.googlesource.com/134321
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-06-12 15:47:53 +00:00
Mike Klein
b82c3d6ff2 simplify SkTFitsIn
Now that we're C++14, a constexpr SkTFitsIn() is a lot easier.
All the old tests still pass, and one new added.

Updated the comments a bit for correctness and readability.

Change-Id: I0f60e32e545fe4f2fb14e66a2bf25d562dbd680f
Reviewed-on: https://skia-review.googlesource.com/133831
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-06-12 15:44:23 +00:00
Hal Canary
2a2f675926 SkTypes: extract SkTo
Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
Reviewed-on: https://skia-review.googlesource.com/133620
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-12 15:03:21 +00:00
Robert Phillips
7c525e62d4 Plumb GrContext everywhere
There is no good way to split the monster CL up. This breaks out
the GrContext plumbing but doesn't use it.

Change-Id: I90856d428d372bcec3f8821e6364667b367927d4
Reviewed-on: https://skia-review.googlesource.com/133382
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-06-12 14:43:03 +00:00
Cary Clark
efd99cc928 clean up SkPicture include
Get SkPicture.h ready for documenting.

- remove private methods
- move private forward declarations
- name parameters

R=reed@google.com, bsalomon@google.com

Bug: skia:6898
Change-Id: I28829111203d8ae2a4661cf02c99023403aa0df0
Reviewed-on: https://skia-review.googlesource.com/134120
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-06-12 13:56:33 +00:00
Mike Klein
bf45c70639 Clean up a few IWYU issues
Spun off from the SkTFitsIn CL.

Change-Id: I686d680df6a36ebc02db3847ad5e2cedcbcd67ef
Reviewed-on: https://skia-review.googlesource.com/134083
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-06-11 19:40:44 +00:00
Mike Klein
79aea6a147 trim #include <new> from SkPostConfig.h
Change-Id: I693ddcd4ade101ba4eb4102e03adce183aa1d672
Reviewed-on: https://skia-review.googlesource.com/133829
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-06-11 15:55:31 +00:00
Mike Klein
692e29ebcd remove unused parts of SkTypes.h
Lots of completely unused bits and bobs removed.

I've decided SK_SUPPORT_UNITTEST and its single use are not
very compelling.

tests/CPlusPlusEleven was the only user of Sk32ToBool(),
and no longer generally needed.

Change-Id: I3ee75560f1e1e1cf5ad89ee7df8d7694b5dffdb3
Reviewed-on: https://skia-review.googlesource.com/133622
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-08 23:53:57 +00:00
Greg Daniel
09c9400695 Reland "Reland "Require mips to be allocated at texture creation time and disable late allocations.""
This reverts commit 01422bc8ef.

Reason for revert: follow on change may be ready

Original change's description:
> Revert "Reland "Require mips to be allocated at texture creation time and disable late allocations.""
> 
> This reverts commit 9eb36b9eb8.
> 
> Reason for revert: Alpha8 isn't renderable on es2 so we end up dropping draws on certain A8 mip requests
> 
> Original change's description:
> > Reland "Require mips to be allocated at texture creation time and disable late allocations."
> > 
> > This reverts commit 0c78238e29.
> > 
> > Reason for revert: <INSERT REASONING HERE>
> > 
> > Original change's description:
> > > Revert "Require mips to be allocated at texture creation time and disable late allocations."
> > > 
> > > This reverts commit cd2c3f9055.
> > > 
> > > Reason for revert: Looks to be causing angle failures on initial clear test
> > > 
> > > Original change's description:
> > > > Require mips to be allocated at texture creation time and disable late allocations.
> > > > 
> > > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we
> > > > will copy the texture into a new mipped texture.
> > > > 
> > > > Clean up of unused code in the GPU backends for reallocating for mips will be done
> > > > in a follow up CL.
> > > > 
> > > > Bug: skia:
> > > > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188
> > > > Reviewed-on: https://skia-review.googlesource.com/132830
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > 
> > >
> > > 
> > > Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:
> > > Reviewed-on: https://skia-review.googlesource.com/133041
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > 
> > Bug: skia:
> > Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4
> > Reviewed-on: https://skia-review.googlesource.com/133340
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I9e9718d380c4d9927ec39e46008750ab7396391f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/133680
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ic3df69f65a89962b21cdb50ee436a29fd121ab1f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/133740
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-08 23:01:44 +00:00
Brian Salomon
802cb318f6 Stop passing GrPrimitiveProcessor to GrMesh::sendToGpu.
It is currently used in GrGLGpu::setupGeometry. Instead:

1) Make GrMesh track whether primitive restart should be enabled.

2) Make GrGLProgram track program attributes.

Change-Id: Ice411a495961fcbc3cedc81e8ae0583537f42153
Reviewed-on: https://skia-review.googlesource.com/132267
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-06-08 22:32:02 +00:00
Herb Derby
65b7bfcf61 Glyph search of desperation
Change-Id: I0ae768c5517c3ee3f6822fea0926b3f27214a0e4
Reviewed-on: https://skia-review.googlesource.com/132260
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-08 22:26:32 +00:00
Greg Daniel
01422bc8ef Revert "Reland "Require mips to be allocated at texture creation time and disable late allocations.""
This reverts commit 9eb36b9eb8.

Reason for revert: Alpha8 isn't renderable on es2 so we end up dropping draws on certain A8 mip requests

Original change's description:
> Reland "Require mips to be allocated at texture creation time and disable late allocations."
> 
> This reverts commit 0c78238e29.
> 
> Reason for revert: <INSERT REASONING HERE>
> 
> Original change's description:
> > Revert "Require mips to be allocated at texture creation time and disable late allocations."
> > 
> > This reverts commit cd2c3f9055.
> > 
> > Reason for revert: Looks to be causing angle failures on initial clear test
> > 
> > Original change's description:
> > > Require mips to be allocated at texture creation time and disable late allocations.
> > > 
> > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we
> > > will copy the texture into a new mipped texture.
> > > 
> > > Clean up of unused code in the GPU backends for reallocating for mips will be done
> > > in a follow up CL.
> > > 
> > > Bug: skia:
> > > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188
> > > Reviewed-on: https://skia-review.googlesource.com/132830
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > 
> >
> > 
> > Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:
> > Reviewed-on: https://skia-review.googlesource.com/133041
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> Bug: skia:
> Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4
> Reviewed-on: https://skia-review.googlesource.com/133340
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I9e9718d380c4d9927ec39e46008750ab7396391f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/133680
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-08 22:01:23 +00:00
Mike Klein
f32fe56710 see if we can remove this hack
Change-Id: I3bb010375c8693c7d6bf726d895cf9878211d4d8
Reviewed-on: https://skia-review.googlesource.com/133585
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-06-08 20:58:04 +00:00
Cary Clark
27dddae313 rebase
This reverts commit 32a4910e57.

Reason for revert: SkMatrix::toString use has been removed from flutter
and has been picked up in fuchsia

Additionally some bookmaker changes take into account recent
additions of typedef comments and the generated header comment.

Original change's description:
> Revert "remove toString"
>
> This reverts commit 5191880cbf.
>
> Reason for revert: broke flutter
>
> Original change's description:
> > remove toString
> >
> > toString may have been used by obsolete debugger only
> > find out if that is so
> >
> > R=​brianosman@google.com,bsalomon@google.com
> >
> > Docs-Preview: https://skia.org/?cl=119894
> > Bug:830651
> > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
> > Reviewed-on: https://skia-review.googlesource.com/119894
> > Commit-Queue: Cary Clark <caryclark@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org
>
> Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c

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

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

Reviewed-on: https://skia-review.googlesource.com/129623
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@google.com>
Docs-Preview: https://skia.org/?cl=133583
Bug: 830651
Change-Id: If8499e796be63580ad419e150e94d43e8b89de1b
Reviewed-on: https://skia-review.googlesource.com/133583
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-06-08 20:36:53 +00:00
Chris Dalton
afa11586d7 Make the SkPathRef GenIDChangeListener ref counted
Bug: skia:
Change-Id: I2780e3fc76153373b4efca6059ded82f4f749325
Reviewed-on: https://skia-review.googlesource.com/133502
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-06-08 20:15:03 +00:00
Herb Derby
59d997a6e1 New more efficient run builder
A system for building glyph runs. In the future the builder will
only live in canvas, but it's internal structures facilitate
interacting with the cache a single glyph at a time. When all
the bulk code is in place, only runs will be passed around.

Passing the builder down the text draw stack is temporary.

Change-Id: I6e3ed184b3f3a58b919377f2d31936e971bd8efa
Reviewed-on: https://skia-review.googlesource.com/132928
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-08 19:25:43 +00:00
Greg Daniel
9eb36b9eb8 Reland "Require mips to be allocated at texture creation time and disable late allocations."
This reverts commit 0c78238e29.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Require mips to be allocated at texture creation time and disable late allocations."
> 
> This reverts commit cd2c3f9055.
> 
> Reason for revert: Looks to be causing angle failures on initial clear test
> 
> Original change's description:
> > Require mips to be allocated at texture creation time and disable late allocations.
> > 
> > If we get a non-mipped texture for a draw that wants to be use mip map filter, we
> > will copy the texture into a new mipped texture.
> > 
> > Clean up of unused code in the GPU backends for reallocating for mips will be done
> > in a follow up CL.
> > 
> > Bug: skia:
> > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188
> > Reviewed-on: https://skia-review.googlesource.com/132830
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
>
> 
> Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/133041
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:
Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4
Reviewed-on: https://skia-review.googlesource.com/133340
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-08 17:39:33 +00:00
Cary Clark
9149954e3a update SkColor
SkColor.h generated include.

Also add generated comment for all files.
And, added typedef documentation where missing.

TBR=reed@google.com

Bug: skia:6898
Change-Id: Ib7757d70c1926b5ae04a5de557711756fce631b6
Reviewed-on: https://skia-review.googlesource.com/132827
Auto-Submit: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-06-08 16:36:31 +00:00
Mike Klein
5f444c9072 remove final SkTypes dependencies in SkArenaAlloc
Change-Id: I09ab433fecdba01f8e652816be08817da68eea56
Reviewed-on: https://skia-review.googlesource.com/132926
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-06-08 15:34:11 +00:00
Mike Klein
9f752aada3 tweak SkArenaAlloc comments, parameter names
Change-Id: Ie7518f2ad2e0f11f0acd5a3bfeff4e5ca7188311
Reviewed-on: https://skia-review.googlesource.com/132925
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-06-07 22:59:36 +00:00
Mike Klein
2e361a3c34 remove unused stat tracking from SkArenaAlloc
I'm really only trying to remove the dependency on SkDebugf().
If we want to keep this, I could switch it to take an optional
stats callback called in the destructor?

Change-Id: I5aa2a58ccc7c8e17e61f29b482b2851be056fa07
Reviewed-on: https://skia-review.googlesource.com/132922
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-06-07 20:51:06 +00:00
Greg Daniel
0c78238e29 Revert "Require mips to be allocated at texture creation time and disable late allocations."
This reverts commit cd2c3f9055.

Reason for revert: Looks to be causing angle failures on initial clear test

Original change's description:
> Require mips to be allocated at texture creation time and disable late allocations.
> 
> If we get a non-mipped texture for a draw that wants to be use mip map filter, we
> will copy the texture into a new mipped texture.
> 
> Clean up of unused code in the GPU backends for reallocating for mips will be done
> in a follow up CL.
> 
> Bug: skia:
> Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188
> Reviewed-on: https://skia-review.googlesource.com/132830
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/133041
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-07 20:11:33 +00:00
Greg Daniel
cd2c3f9055 Require mips to be allocated at texture creation time and disable late allocations.
If we get a non-mipped texture for a draw that wants to be use mip map filter, we
will copy the texture into a new mipped texture.

Clean up of unused code in the GPU backends for reallocating for mips will be done
in a follow up CL.

Bug: skia:
Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188
Reviewed-on: https://skia-review.googlesource.com/132830
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-07 19:35:01 +00:00
Ben Wagner
c174cc675c Add SkTypeface::makeClone.
This adds an method to typeface to allow users to create a copy of the
typeface with different arguments for its parameters. This is far more
efficient when animating a variation font.

BUG=skia:7121

Change-Id: I34e7557a08c7005f8149ea44f0c28de9c59d15a7
Reviewed-on: https://skia-review.googlesource.com/132480
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-06-07 19:32:11 +00:00
Khushal
fa8ff09457 fonts: Hook up FallbackTextHelper to font remoting.
Use GrContext::FallbackTextHelper in SkTextBlobCacheDiffCanvas to
replicate glyph generation logic for fallback text during analysis. This
ensures that we correctly handle these fallback cases when using
distance field or paths for text rendering.

R=herb@google.com, jvanverth@google.com

Bug: skia:7913
Change-Id: I3067c4f1bd09231a564ac7c4cd89efcb876d2abd
Reviewed-on: https://skia-review.googlesource.com/132285
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-06-07 18:03:11 +00:00
Greg Daniel
dc636203f4 Add guard around GrVkBackendContext::Create function.
Just want to make sure the use of this doesn't leak out to other users
as I work on removing it.

Bug: skia:
Change-Id: I5ecf11615db64bd489065e6f67e0e1d4bb3298eb
Reviewed-on: https://skia-review.googlesource.com/132831
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-07 16:32:11 +00:00
Mike Klein
d62c4bd38c require std::is_trivially_destructible
Change-Id: I78cbaf420ad1e16f07eacb8b4c6c825fe849b08a
Reviewed-on: https://skia-review.googlesource.com/132825
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-07 16:03:31 +00:00
Mike Klein
d07dc361bc clean up some unused parts of SkArenaAlloc
I'm looking at making SkArenaAlloc independent of Skia.
Here's a bit of low-hanging fruit.

Nothing is using makeSkSp().  Good... it seems real dangerous.

Change-Id: Ib7154e7948a3c6d828376ef37935636b3b4695ff
Reviewed-on: https://skia-review.googlesource.com/132824
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-06-07 14:21:28 +00:00
Herb Derby
4ffa027cf6 Smarter use of glyph cache
Change-Id: Ic9bea7310b375575503042881d9d54ff13996729
Reviewed-on: https://skia-review.googlesource.com/131924
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-06-06 19:07:52 +00:00
Mike Klein
12f25a2c22 simplify SK_FloatNaN
math.h contains NAN, an expression that evaluates to a quiet float NaN
While here, INFINITY is also a float, so the casts aren't needed.

Change-Id: Ibdd8f5a2767651cd4382d700e9125b832473a304
Reviewed-on: https://skia-review.googlesource.com/132087
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-06-05 16:01:28 +00:00
Brian Osman
e1adc3a955 Remove color space restrictions from image infos
What makes an info valid (or invalid)? Nothing to do with
color space.

Bug: skia:
Change-Id: I6795efa9aa74ab0d65935c5ddccc1058f8e0b112
Reviewed-on: https://skia-review.googlesource.com/131780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-06-04 14:07:48 +00:00
Greg Daniel
8683037a2e Always keep buffers in vulkan persistently mapped.
This should hopefully fix (and possibly even improve) some of the perf
regressions we had form switching the memory allocator which were caused
by us now mapping and unmapping the entire VkDeviceMemory instead of just
subsets.

Bug: skia:
Change-Id: Ia8232594f33003e88969bf16febea4e4eec0ac95
Reviewed-on: https://skia-review.googlesource.com/131443
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-06-01 18:01:26 +00:00
Brian Osman
2b23c4bf31 Dest color space no longer impacts mipmaps or texture sampling
PS5: Removes SkDestinationSurfaceColorMode, tracking of mipmap
mode on GrTexture, sRGB decode state per-texture. Because we
were often choosing sRGB configs for RGB color types, legacy
rendering would then be incorrect (too dark). So...

PS7: Stops ever using sRGB pixel configs when translating
image info or color type. Also removes a bunch of GrCaps bits
and a GrContextOption that are no longer relevant.

PS9: Adjusts surface creation unit test expectations, and
changes the raster rules accordingly.

At this point, sRGB configs are (obviously) going to be broken.

Locally, I ran 8888, gl, and the gbr- versions of both. Across
all GMs x configs, there are 13 diffs. 12 are GMs that create
surfaces with a color-space attached (and thus, the offscreen
is no longer getting sRGB pixel config). The only remainder
constructs an SkPictureImageGenerator, (with an attached color
space) and renders it to the gbr-gl canvas, which triggers a
a tagged surface inside the generator.

Bug: skia:
Change-Id: Ie5edfa157dd799f3121e8173fc4f97f6c8ed6789
Reviewed-on: https://skia-review.googlesource.com/131282
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-01 17:00:26 +00:00
Derek Sollenberger
8103bb9609 Expose API for temporary use by the Android WebView.
The WebView needs this information in order to correctly draw into
an unclipped layer. This API can be removed when we update the
Android framework to no longer depend on unclipped layers.

Change-Id: Ibba63005730158021363d1d09e5338578f4fa541
Reviewed-on: https://skia-review.googlesource.com/131148
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2018-05-31 18:21:50 +00:00