Commit Graph

17 Commits

Author SHA1 Message Date
Adlai Holler
302e8fb771 Downgrade SkImage to GrImageContext
We still occasionally downcast, so this is not airtight,
but it (1) allows us to know where we are downcasting and
(2) lets us move away from GrContext (and hopefully remove
it sooner than later.)

All three canaries are currently broken =( so here we go!

Bug: skia:104662
Change-Id: I84efe132574690b62ea512e194e4f9e318e9c050
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316218
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-14 17:01:07 +00:00
John Stiles
7571f9e490 Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'.
Mechanically updated via Xcode "Replace Regular Expression":

  typedef (.*) INHERITED;
    -->
  using INHERITED = $1;

The ClangTidy approach generated an even larger CL which would have
required a significant amount of hand-tweaking to be usable.

Change-Id: I671dc9d9efdf6d60151325c8d4d13fad7e10a15b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314999
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-03 03:41:26 +00:00
Robert Phillips
a84caa3a5f Make some GMs compatible with the *ooprddl configs
The more we can test these configs the better.

Change-Id: I2d86985770047937d7f31c9659ad6984caafe11d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305569
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-07-28 14:33:11 +00:00
Brian Salomon
7e67dcaea6 Rename GrMipMapped GrMipmapped
Change-Id: Ia2cfbca8982b57399b6681cbb4501c2933ab4df7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304576
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-07-21 14:06:35 +00:00
Adlai Holler
4caa935bfe Migrate MakeTextureImage to take GrDirectContext
This is part of a larger effort to force SkImage users to specify
the direct context they want to use when manipulating GPU images.

Chrome CL 2299194 (landed) enables the staging flag.

bug: skia:10466
Change-Id: I959db57dd8dca5c2622eb5ffaa7de161c4d6d8f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302643
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-16 16:17:28 +00:00
Mike Reed
13711ebe68 rename SkMipMap to SkMipmap
Change-Id: I1fa8a0482a717847236a30b4851061f4074b7755
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302644
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-07-15 13:26:13 +00:00
Robert Phillips
b7bfbc299a Move GrRecordingContext.h and GrDirectContext.h into include/gpu
External clients will need access to these classes once GrContext
goes away.

This is a purely mechanical CL.

Bug: skia:10441
Change-Id: I7ffeb29d88bcc0f012412fba911e8362d046e24a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300206
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-01 17:32:14 +00:00
Robert Phillips
95c250c247 Downgrade GpuGMs to only receiving a GrRecordingContext
Most of this CL is just noise (i.e., all the header changes) due to the
signature change. The 'discard' GM has some substantive changes but
that's about it.

Change-Id: I72011a442c149b5db93cf8decade6779be4f63d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296704
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-06-30 13:02:33 +00:00
Brian Osman
788b91678f Remove SkTMin and SkTMax
Use std::min and std::max everywhere.

SkTPin still exists. We can't use std::clamp yet, and even when
we can, it has undefined behavior with NaN. SkTPin is written
to ensure that we return a value in the [lo, hi] range.

Change-Id: I506852a36e024ae405358d5078a872e2c77fa71e
Docs-Preview: https://skia.org/?cl=269357
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269357
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-02-07 18:40:09 +00:00
Robert Phillips
e0735529fa Minor GM cleanup
This CL:
1) Makes the compressed_textures GM use a red outline to indicate decompression (instead of a color rotation)

2) Disallows GPU resizing of textures w/ alpha in the wacky_yuv_formats GM

3) Guards GrTwoColorBC1Compress with GR_TEST_UTILS to make it clear that it is just a testing utility

4) Fixes the wacky_yuv_formats GM on platforms with RGBA PM color order

Change-Id: I3942c4ab1d2c1fab3c8d39c6c99136b75ba10132
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268119
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-31 19:06:19 +00:00
Robert Phillips
45c9487914 Add SkImage::MakeTextureFromCompressed and deprecate MakeFromCompressed
Bug: skia:9680
Change-Id: Ifb8bc362cb2d2d3c0640f81eb6a11a613bf18de6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267178
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-29 13:21:55 +00:00
Robert Phillips
162e04b9a9 Expand the compressed_textures GM
This CL adds testing for some edge cases in compressed texture handling

Bug: skia:9680
Change-Id: I4915f46bca9e2fb5c827a51152f28dc1e9d22942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266201
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-01-28 20:34:18 +00:00
Robert Phillips
99dead9830 Add SkImage::MakeRasterFromCompressed and make MakeFromCompressed fall back to decompression for unsupported compression types (take 2)
This is intended to make using compressed textures easier since developers can just provided compressed data and it will be uploaded to the GPU in some way, shape or form.


TBR=reed@google.com
Change-Id: I8c672ccc7db5cd098f629c3469ae7cbdc7436392
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266939
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-28 14:03:14 +00:00
Robert Phillips
3da9e94289 Revert "Add SkImage::MakeRasterFromCompressed and make MakeFromCompressed fall back to decompression for unsupported compression types"
This reverts commit 3234ce1347.

Reason for revert: missing etc1.h

Original change's description:
> Add SkImage::MakeRasterFromCompressed and make MakeFromCompressed fall back to decompression for unsupported compression types
> 
> This is intended to make using compressed textures easier since developers can just provided compressed data and it will be uploaded to the GPU in some way, shape or form.
> 
> Change-Id: Ieed008f083d6e3594eaa9a02bc5348e00ee60d2a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265601
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ia497e6767c43ab6f8bfeb28e70244107a1442cf2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/266937
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-27 21:05:46 +00:00
Robert Phillips
3234ce1347 Add SkImage::MakeRasterFromCompressed and make MakeFromCompressed fall back to decompression for unsupported compression types
This is intended to make using compressed textures easier since developers can just provided compressed data and it will be uploaded to the GPU in some way, shape or form.

Change-Id: Ieed008f083d6e3594eaa9a02bc5348e00ee60d2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265601
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-27 20:15:36 +00:00
Robert Phillips
b0855273ab Add SkImage::CompressionType::kBC1_RGBA8_UNORM support
This is mainly so we can test the compression code on macOS.

Bug: skia:9680
Change-Id: Ie0a2eacfe9100ee4ce4cc94c878d3032d6985832
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264480
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-01-16 21:45:33 +00:00
Robert Phillips
ac9080283e Update compressed texturing GM
This CL has some extra headroom for upcoming kBC1_RGBA8_UNORM support.

Bug: skia:9680
Change-Id: I866c7fe12657a41575c57dcd001a6a09477fc44a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264096
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-01-14 23:23:48 +00:00