Commit Graph

6583 Commits

Author SHA1 Message Date
Mike Reed
569dda7216 hide SkFont::containsText
Bug: skia:
Change-Id: I197addb0ea1da57083283b30e19e290cdaf8dac6
Reviewed-on: https://skia-review.googlesource.com/c/188581
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-01 10:54:53 +00:00
Greg Daniel
932dd07e4c Fix type in Andoird string.
Bug: skia:
Change-Id: I975a7cb8e67735c3c27eec100204fb470cd89e56
Reviewed-on: https://skia-review.googlesource.com/c/188309
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-01-31 20:12:22 +00:00
Mike Reed
1c2052363e fix tiler to handle large float rects
The issue is around needing to go from a float rect to a clipped (intersected
with the clip bounds) irect.

The old code promoted the clip bounds to rect,
intersected with the rect, and then rounded to ints. This is problematic
since convert float --> int can produce float values that are larger than
their int counter-parts. (e.g. int:67108863 becomes float:67108864).
This error goes on to confuse subsequent logic.

The fix is to round the rect to int first (knowing that very large floats
will saturate to maxint), and then intersect.

Bug: 927075
Change-Id: If6c7d72ff15184700b87532e1922e576d1348ee8
Reviewed-on: https://skia-review.googlesource.com/c/188307
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-31 19:34:42 +00:00
Greg Daniel
24d861d8bf Add hardware buffer unit test from old skqp to skia.
This copies the hardware buffer unit test from, which was cherry picked
straight into skqp last year, into Skia proper.

There are not functional changes, but a few of the APIs have been updated
to work with newer Skia.

Bug: skia:
Change-Id: I2d7b2ed8b0b9314ca3e03e703a6a5ac53805275e
Reviewed-on: https://skia-review.googlesource.com/c/188034
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-01-31 17:44:52 +00:00
Brian Salomon
f55e8d5232 Add option to skip intermediate release/fulfill calls for promise images.
SkiaRenderer does not delete promise image textures when they are released
but not done. Refulfilling promise image textures takes a significant amount
of CPU time. This allows us to fulfill each promise image once.

Bug: skia:8736
Change-Id: I7ad7fa9678ed0ec4bb714b71fbf920ab4a845409
Reviewed-on: https://skia-review.googlesource.com/c/188039
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-31 16:24:52 +00:00
Leon Scroggins III
95d0c8d21c Fix bug in sampling rotated decodes
Bug: b/122338652
Bug: b/77339676

getSampledDimensions is supposed to report dimensions that
SkAndroidCodec can decode to. But if SkAndroidCodec is respecting an
orientation that requires swapping the width and the height,
getSampledDimensions needs to do so, too.

Change-Id: I0cacefc2b02eb9832b8c029c88bcaaedcb2ba82b
Reviewed-on: https://skia-review.googlesource.com/c/188035
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2019-01-30 21:10:28 +00:00
Mike Klein
ac262a0368 remove Sk4x4f.h -- dead code
Change-Id: I03d15a563eeb7ea187c7d48deffe00357dc55177
Reviewed-on: https://skia-review.googlesource.com/c/188032
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-01-30 19:00:21 +00:00
Robert Phillips
4217ea7ee5 Add outline of new GrContext hierarchy
This begins the process of splitting GrContext into:

GrContext_Base, GrImageContext, GrRecordingContext and GrDirectContext.

Change-Id: I3c43045f2a5549b049e95791d65f74d4e16de36f
Reviewed-on: https://skia-review.googlesource.com/c/186878
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-01-30 18:36:11 +00:00
Brian Salomon
59ef8c36c1 Remove legacy texture-backed promise image interface.
No longer used by Chrome.

Change-Id: I842482490f132bb3aa3e85f847d8d4167f5595df
Reviewed-on: https://skia-review.googlesource.com/c/188029
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-30 18:09:21 +00:00
Mike Reed
673a048b20 hide deprecated breaktext
Bug: skia:
Change-Id: I5a2f4d96f8e0ad299cf1b4f6e87f0e0d98afde5a
Reviewed-on: https://skia-review.googlesource.com/c/188020
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-30 13:58:41 +00:00
Brian Salomon
12d2264c26 Convert GrBuffer owners to sk_sp
Change-Id: Id49d775c30f01f4de05f385227c5ed5d90d6839e
Reviewed-on: https://skia-review.googlesource.com/c/187920
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-01-29 21:11:27 +00:00
Robert Phillips
a0bc39dce3 Split GrContextThreadSafeProxy into its own files (take 2)
This just shuffles stuff around.

Change-Id: I90e24a73bf44dd3e88fc121a0528bf94e4fdead4
Reviewed-on: https://skia-review.googlesource.com/c/187786
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-01-29 19:26:47 +00:00
Robert Phillips
ea8b4fc950 Revert "Split GrContextThreadSafeProxy into its own files"
This reverts commit f8397f2b3f.

Reason for revert: Breaking Flutter build!

Original change's description:
> Split GrContextThreadSafeProxy into its own files
> 
> This just shuffles stuff around.
> 
> Change-Id: Ieab35f50945efe87512d7077cb994132f0e0b6ef
> Reviewed-on: https://skia-review.googlesource.com/c/186874
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I236add95d8a0066037854b5532a7db131d93d603
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/187783
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-01-29 14:39:19 +00:00
Robert Phillips
f8397f2b3f Split GrContextThreadSafeProxy into its own files
This just shuffles stuff around.

Change-Id: Ieab35f50945efe87512d7077cb994132f0e0b6ef
Reviewed-on: https://skia-review.googlesource.com/c/186874
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-01-29 14:03:47 +00:00
Mike Reed
5f528e5fd8 Revert "Reland "Revert "remove legacy code for text attributes on paint"""
This reverts commit 3c03c851ad.

Modification was to copy/assign fBitfieldsUInt rather than fBitfields,
since fBitfields might be smaller, and therefore ignore some bits that
we do use in hashing, etc.

Bug: skia:
Change-Id: I5965d5d64bd22bd60f0da797fdfeeffb730588ea
Reviewed-on: https://skia-review.googlesource.com/c/187307
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-28 18:27:26 +00:00
Mike Reed
3c03c851ad Reland "Revert "remove legacy code for text attributes on paint""
This reverts commit fd0bba81c0.

Reason for revert: PaintTest.cpp:150 failing

Original change's description:
> Revert "Revert "remove legacy code for text attributes on paint""
> 
> This reverts commit fb0e2aa8fd.
> 
> Bug: skia:
> Change-Id: I16bf3c999233f7498a4d76dfbcfb26be725e88f5
> Reviewed-on: https://skia-review.googlesource.com/c/187261
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Ic52282f36841b7402a3a5466b93ef56ecdb6f51b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/187306
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-28 15:02:08 +00:00
Mike Reed
fd0bba81c0 Revert "Revert "remove legacy code for text attributes on paint""
This reverts commit fb0e2aa8fd.

Bug: skia:
Change-Id: I16bf3c999233f7498a4d76dfbcfb26be725e88f5
Reviewed-on: https://skia-review.googlesource.com/c/187261
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-28 13:56:24 +00:00
Mike Reed
fb0e2aa8fd Revert "remove legacy code for text attributes on paint"
This reverts commit 80f4adf98f.

Reason for revert: breaking PaintTest

Original change's description:
> remove legacy code for text attributes on paint
> 
> Bug: skia:2664
> Change-Id: I09f9d1401410d7ca338d7acde5a9660921c74da9
> Reviewed-on: https://skia-review.googlesource.com/c/185460
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=bungeman@google.com,rmistry@google.com,herb@google.com,fmalita@chromium.org,reed@google.com

Change-Id: If9bbb92d6eb064aba30cfa9069051ff60585a269
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:2664
Reviewed-on: https://skia-review.googlesource.com/c/187260
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-28 00:18:09 +00:00
Mike Reed
80f4adf98f remove legacy code for text attributes on paint
Bug: skia:2664
Change-Id: I09f9d1401410d7ca338d7acde5a9660921c74da9
Reviewed-on: https://skia-review.googlesource.com/c/185460
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-01-27 23:54:45 +00:00
Ethan Nicholas
842d31b141 fixed Metal matrix constructors
Bug: skia:8544
Change-Id: Ie1e96ab1ef6e8c032fa510be36c035f91a1f6851
Reviewed-on: https://skia-review.googlesource.com/c/185687
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-01-25 18:37:34 +00:00
Brian Salomon
35ba614dc5 Remove GrGpuResource::abandon from the public API.
Bug: skia:7966
Change-Id: I222db4f4bc765fad3e5f1461f3a8f3c663bb9429
Reviewed-on: https://skia-review.googlesource.com/c/186545
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-25 15:37:20 +00:00
Brian Salomon
9bc76d96f9 Change the meaning of GrBudgetedType::kUnbudgetedUncacheable.
kUnbudgetedCacheable now means that the resource is never purged
until its unique key is removed.

This fixes an issue where a cached texture for a promise image
might get purged by cache pressure. This in turn could cause
Skia to call the promise image's Fulfill proc multiple times with
no intervening Release calls. The balancing Release calls would
occur, but the policy is that each Fulfill should be balanced by
Release *before* another Fulfill.

Update/add unit tests.

Bug: chromium:922851
Change-Id: I6411e413b3104721ca4bb6e7f07b3b73d14cbcf9
Reviewed-on: https://skia-review.googlesource.com/c/186361
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-25 14:13:00 +00:00
Brian Salomon
aa6ca0a8bf Require explicit GrWrapCacheable specification in more places.
Make all wrapped resources be kUnbudgetedUncacheable except those
created by AHardwareBuffer image generators and as backings for promise
images.

Make all non-wrapped unbudgeted resources be kUnbudgetedUncacheable.

Update unit tests to mostly use GrWrapCacheable::kNo except where they
are testing the distinction.

Update unit tests for new expectations.
Bug: chromium:922851
Change-Id: I4d3bdaa161ffc76390f26334bcb7e2b47dd9319d
Reviewed-on: https://skia-review.googlesource.com/c/185004
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-25 00:29:27 +00:00
Brian Salomon
fa2ebeaf33 Replace bool purgeImmediately with enum GrWrapCacheable.
Store budgeted status as a tri-state enum on GrGpuResource:
kBudgeted
kUnbudgetedCacheable
kUnbudgetedUncacheable

Uncacheable vs. Cacheable captures the current distinction between
wrapped resources created with purgeImmediately or !purgeImmediately.

Non-wrapped and unbudgeted resources are all kUnbudgetedCacheable to
match current behavior.

This change just introduces the new types. No behavior is changed.

Bug: chromium:922851

Change-Id: Ic2387bf321cf9b56b4c9ffd9dbef8ade60f9cb98
Reviewed-on: https://skia-review.googlesource.com/c/185003
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-24 21:26:24 +00:00
Brian Osman
5deadca8fe Remove nearly all use of SkColorSpaceTransferFn
Most interfaces had migrated to skcms_TransferFunction. Having both was
awkward in several places, so this (almost) finishes the migration. Some
clients are calling SkICC::WriteToICC, so that's left intact. After this
CL, those clients can switch to using SkWriteICCProfile directly, and
WriteToICC can be deleted.

Bug: skia:
Change-Id: I46ebaeb1f5b20bf0c620e8a620e73ee323a1de31
Reviewed-on: https://skia-review.googlesource.com/c/186541
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-01-24 17:45:19 +00:00
Herb Derby
087fad7900 Add getTypefaceOrDefault and refTypefaceOrDefault
* Remove GetTypefaceOrDefault from SkPaint and SkFont
* Remove RefTypefaceOrDefault from SkPaint and SkFont

Change-Id: I04ae777142c2bdec849508b611b844418bbaedff
Reviewed-on: https://skia-review.googlesource.com/c/185781
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-01-23 18:52:09 +00:00
Chris Dalton
945ee652d7 Enforce non-overlap constraint from GrRenderTargetOpList
Enforces this constraint from one central location, rather than
relying on each Op to remember to check if overlap is allowed from its
onCombineIfPossible method.

Fixes an issue where we need to check the total bounds of both chains
for overlap (not the bounds of individual Ops).

Bug: skia:8671
Change-Id: I163651c868847884459acfc00d13ffdfca3a27c3
Reviewed-on: https://skia-review.googlesource.com/c/185815
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-01-23 16:48:15 +00:00
Mike Reed
77f94ea72b Move more utils into SkFontPriv, IWYU
Fissioned from https://skia-review.googlesource.com/c/skia/+/185460

Bug: skia:
Change-Id: Iaf980e931c17196f917602fc58fc39ab51e3d248
Reviewed-on: https://skia-review.googlesource.com/c/185840
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-22 22:24:03 +00:00
Brian Osman
02518801df Remove SkGammaNamed / gammaNamed() from SkColorSpace
Note: This removes from the public API. The two most commonly
checked values from gammaNamed can still be tested with
gammaCloseToSRGB and gammaIsLinear.

Others can be tested for (exact or approximate) equality by
calling isNumericalTransferFn, and testing the resulting
skcms_TransferFunction in any method the client wants.

Bug: skia:
Change-Id: I9b63ffea81bba461795cad946050c7083b02eec8
Reviewed-on: https://skia-review.googlesource.com/c/185684
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-01-22 20:52:35 +00:00
Hal Canary
02738a86e5 Revert "hide hinting and flag enums with PAINT_FLAGS"
This reverts commit 5d052dac3a.

Reason for revert: BREAKS CHROMIUM ROLL.

https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/fonts/win/font_platform_data_win.cc?l=49
|   FAILED: obj/third_party/blink/renderer/platform/platform/font_platform_data_win.obj
|   ../../third_party/blink/renderer/platform/fonts/win/font_platform_data_win.cc(49,29):
|     error: no member named 'kLCDRenderText_Flag' in 'SkPaint'
|     if (text_flags & SkPaint::kLCDRenderText_Flag) {
|                      ~~~~~~~~~^
|   ../../third_party/blink/renderer/platform/fonts/win/font_platform_data_win.cc(51,36):
|     error: no member named 'kAntiAlias_Flag' in 'SkPaint'
|     } else if (text_flags & SkPaint::kAntiAlias_Flag) {
|                             ~~~~~~~~~^
|   ../../third_party/blink/renderer/platform/fonts/win/font_platform_data_win.cc(56,52):
|     error: no member named 'kSubpixelText_Flag' in 'SkPaint'
|     font->setSubpixel(SkToBool(text_flags & SkPaint::kSubpixelText_Flag));
|                                             ~~~~~~~~~^
|   ../../third_party/blink/renderer/platform/fonts/win/font_platform_data_win.cc(64,29):
|     error: no member named 'kAntiAlias_Flag' in 'SkPaint'
|     if (text_flags & SkPaint::kAntiAlias_Flag)
|                      ~~~~~~~~~^
|   ../../third_party/blink/renderer/platform/fonts/win/font_platform_data_win.cc(85,27):
|     error: no member named 'kAntiAlias_Flag' in 'SkPaint'
|                  ? SkPaint::kAntiAlias_Flag
|                    ~~~~~~~~~^
|   ../../third_party/blink/renderer/platform/fonts/win/font_platform_data_win.cc(91,35):
|     error: no member named 'kLCDRenderText_Flag' in 'SkPaint'
|                          ? SkPaint::kLCDRenderText_Flag
|                            ~~~~~~~~~^
|   ../../third_party/blink/renderer/platform/fonts/win/font_platform_data_win.cc(93,27):
|     error: no member named 'kAntiAlias_Flag' in 'SkPaint'
|       text_flags = SkPaint::kAntiAlias_Flag | lcd_flag;
|                    ~~~~~~~~~^
|   ../../third_party/blink/renderer/platform/fonts/win/font_platform_data_win.cc(101,28):
|     error: no member named 'kAntiAlias_Flag' in 'SkPaint'
|       text_flags |= SkPaint::kAntiAlias_Flag;
|                     ~~~~~~~~~^
|   8 errors generated.

Original change's description:
> hide hinting and flag enums with PAINT_FLAGS
> 
> A preflight for https://skia-review.googlesource.com/c/skia/+/185460
> 
> Bug: skia:2664
> Change-Id: I83f7f9cd500e8507b559462835477ba8ae7c11ab
> Reviewed-on: https://skia-review.googlesource.com/c/185540
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I4d1581a7e29267ad459ed31d4885b823fa00066f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:2664
Reviewed-on: https://skia-review.googlesource.com/c/185680
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-01-21 18:51:39 +00:00
Mike Reed
5d052dac3a hide hinting and flag enums with PAINT_FLAGS
A preflight for https://skia-review.googlesource.com/c/skia/+/185460

Bug: skia:2664
Change-Id: I83f7f9cd500e8507b559462835477ba8ae7c11ab
Reviewed-on: https://skia-review.googlesource.com/c/185540
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-21 15:45:37 +00:00
Hal Canary
3026d4b1b8 SkDocument: use auto for MakeDocument().
A later CL will make this return a unique_ptr<SkDocument>.

Bug: skia:5972
Change-Id: Ie10d6c07d5f2524ecb71d906db0d37427827225d
Reviewed-on: https://skia-review.googlesource.com/c/181660
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-01-17 19:16:28 +00:00
Brian Salomon
1bf0ed8584 Make GrTexture caching for SkPromiseImageTexture work when same texture
fulfills a different SkImage.

Bug: skia:8613
Change-Id: I7ee14112c69f8aaef223a37dda455259b501a2bf
Reviewed-on: https://skia-review.googlesource.com/c/184440
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-16 22:06:53 +00:00
Chris Dalton
4b62aed973 Return GrProcessorSet::Analysis from GrDrawOp::finalize
Bug: skia:8671
Change-Id: Ib35d1642659021419f408bf19b1b0dc0066e8df2
Reviewed-on: https://skia-review.googlesource.com/c/184160
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-01-16 21:22:38 +00:00
Herb Derby
5fd955e36d Rename SkGlyphCache -> SkStrike
Change-Id: I51ca9f61feb0d4f7352ed634b7070327f31ccf05
Reviewed-on: https://skia-review.googlesource.com/c/184400
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-01-16 18:28:28 +00:00
Jim Van Verth
1676cb9282 Restore ETC1 compressed texture support.
Brings back GL ETC1 support and adds Vulkan support as well.

Bug: skia:8684
Change-Id: Ie65da0a3172793081f0e4072f161bfb9b14678bc
Reviewed-on: https://skia-review.googlesource.com/c/179724
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-15 19:56:28 +00:00
Chris Dalton
330b08511d Remove "canCombineOverlappedStencilAndCover"
This looks like a relic from nvpr text.

Bug: skia:8671
Change-Id: I417c7b4565208e3bf91a3891fa59ba50308a8139
Reviewed-on: https://skia-review.googlesource.com/c/183884
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-01-15 02:15:25 +00:00
Mike Reed
31ba6feaf6 unflatten directly to font for legacy skps
All of this extra code/parameter-passing for fonts to the paint unflattener
can go away when we can drop support for older skps

Bug: skia:
Change-Id: I4d626f0925a54564b7c386ed80953a0291c8bc1a
Reviewed-on: https://skia-review.googlesource.com/c/183863
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-01-15 01:25:55 +00:00
Hal Canary
4ca9fa30ba SkPDF: unify Canon and Document
motivation:  The Document has become intrusive enough that we almost
always have a pointer to the Document on hand anyways.

Also: update document.

Also: forward declare more things in headers.

Also, don't try to clean up resources when abort() or close() is called.
It is easy enough for the client to delete the Document when done.

Change-Id: I21aeed37f26ba16d68af041d9317adf00e9a61f2
Reviewed-on: https://skia-review.googlesource.com/c/180646
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-01-14 17:56:14 +00:00
Brian Salomon
3f4cd774e6 Make SkPromiseImageTexture ref counted.
This makes the API easier to use in Chrome.

It is no longer required to pass the SkPromiseImageTexture to the
release proc.

Bug: skia:
Change-Id: I6636401f6a7915d3ad15e890718638bc91a58cc4
Reviewed-on: https://skia-review.googlesource.com/c/183383
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-14 16:19:01 +00:00
Michael Ludwig
a21d196602 Move clear-as-draw caps into GrCaps
Bug: skia:
Change-Id: Ib029f337f5e61366e2550e77dc99310b44d03f84
Reviewed-on: https://skia-review.googlesource.com/c/182970
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-01-14 15:27:44 +00:00
Ethan Nicholas
a7ceb50f50 added PLS support to SkSL
Bug: skia:
Change-Id: I77fb0861c8cba0f86e3d0521d2ad77e204487d21
Reviewed-on: https://skia-review.googlesource.com/c/99921
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-01-11 18:14:50 +00:00
Robert Phillips
27467658dd Reduce reliance on the SkImage_Gpu's GrContext pointer
The SkImages aren't guaranteed to have a full fledged GrContext (e.g., if they are promise images created outside of a DDL recorder). This CL starts the process if lessening Skia's reliance on what ever the SkImage has cached.

Change-Id: I0181d09417e1ea2ced7706a722e2815f3ceee870
Reviewed-on: https://skia-review.googlesource.com/c/182974
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-01-11 16:07:56 +00:00
Mike Reed
e5f9cfad7b expand flag to include all text-related paint fields
Bug: skia:
Change-Id: I8453a6d607df4902cd05c5c9bc6162feda04ef9c
Reviewed-on: https://skia-review.googlesource.com/c/182969
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-10 20:06:07 +00:00
Derek Sollenberger
e6fb76bbd2 Add additional information (e.g. colorspace) to the GpuDrawHandler
Bug: b/115613038
Change-Id: I375fc5f1bac13557b35e39658d678c61f70024c8
Reviewed-on: https://skia-review.googlesource.com/c/182900
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-10 18:49:52 +00:00
Herb Derby
f6fca2668d Make a ctor for SkGlyph
Change-Id: I21a5ed81d3e161ddf8a838ea9ac0414265b00ae6
Reviewed-on: https://skia-review.googlesource.com/c/182701
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-01-10 18:38:11 +00:00
Brian Salomon
cdd8a0a0e8 Revert "Revert "Reuse GrTexture instances when the same GrBackendTexture is used to""
This reverts commit 426ba463d5.

Bug: skia:8613
Change-Id: Iacaf40549369110aa95015e8d4579ec41db22d13
Reviewed-on: https://skia-review.googlesource.com/c/182963
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-10 17:51:21 +00:00
Brian Salomon
426ba463d5 Revert "Reuse GrTexture instances when the same GrBackendTexture is used to"
This reverts commit 559c617137.

Reason for revert: breaking things

Original change's description:
> Reuse GrTexture instances when the same GrBackendTexture is used to
> repeatedly fulfill a promise SkImage.
> 
> Bug: skia:8613
> 
> Change-Id: I35c76435d630d2daa034e0c3efb59666bfd6882a
> Reviewed-on: https://skia-review.googlesource.com/c/175820
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I7548809945d0a875fdb9387398bbc45e733c0846
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8613
Reviewed-on: https://skia-review.googlesource.com/c/182960
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-01-10 16:33:11 +00:00
Brian Salomon
559c617137 Reuse GrTexture instances when the same GrBackendTexture is used to
repeatedly fulfill a promise SkImage.

Bug: skia:8613

Change-Id: I35c76435d630d2daa034e0c3efb59666bfd6882a
Reviewed-on: https://skia-review.googlesource.com/c/175820
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-01-10 16:10:59 +00:00
Brian Osman
c6444d2f26 Enable wide color support in CCPR
Unlike other ops, always use half-float colors. The logic around the
Instance struct makes dynamically switching color size tricky.
CCPR stores color in a per-instance attribute though, so the cost of
always using FP16 is much lower.

Bug: skia:
Change-Id: I9c0c64940f74f915a18417a5830030558e065d28
Reviewed-on: https://skia-review.googlesource.com/c/182760
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-01-10 13:53:31 +00:00