Go to file
John Stiles 3dc0da6c6d Add as<ProgramElementSubclass> to downcast ProgramElements more safely.
The as<T>() function asserts that the ProgramElement is of the correct
kind before performing the downcast, and is also generally easier to
read as function calls flow naturally from left-to-right, and C-style
casts don't.

This CL updates several downcasts throughout SkSL to the as<T>
syntax, but is not intended to exhaustively replace them all (although
that would be ideal). In places where we SkASSERTed the element's
fKind immediately before a cast, the assert has been removed because it
would be redundant with the behavior of as<T>().

Change-Id: I89a487aeaf56e56c720479fee0c2633377a202f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312020
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-08-20 13:48:52 +00:00
animations
bench Can we remove this flag to picture-recording? 2020-08-20 12:29:42 +00:00
bin bin/try: automatically set 'git cl issue' when not found 2020-06-25 17:44:01 +00:00
build/fuchsia [fuchsia] Fix fidlc command. 2020-06-10 03:29:24 +00:00
build_overrides Use Dawn's BUILD.gn instead of defining another one for Skia. 2020-04-13 23:26:31 +00:00
client_utils/android Enable ClangTidy check modernize-make-unique. 2020-08-03 17:53:52 +00:00
demos.skia.org Add path rendering performance demo to demos.skia.org 2020-08-11 19:57:08 +00:00
dm Enable ClangTidy check readability-redundant-smartptr-get. 2020-08-16 15:56:48 +00:00
docker Fix swiftshader Dockerfile. 2020-07-20 17:17:53 +00:00
docs/examples Update more example code to GrDirectContext/GrRecordingContext pair 2020-08-13 19:30:12 +00:00
example Clean up GrContext references in the src/gpu 2020-07-16 14:14:08 +00:00
experimental Revert "remove sksl interpreter guards" 2020-08-20 00:41:15 +00:00
fuzz Enable ClangTidy check readability-redundant-smartptr-get. 2020-08-16 15:56:48 +00:00
gm SkCustomTypefaceBuilder to set SkFontStyle 2020-08-19 00:09:55 +00:00
gn Revert "remove sksl interpreter guards" 2020-08-20 00:41:15 +00:00
include Update Skia milestone to 87 2020-08-20 12:50:02 +00:00
infra [infra] Update go to 1.15 2020-08-17 18:07:57 +00:00
modules Revert "remove sksl interpreter guards" 2020-08-20 00:41:15 +00:00
platform_tools Add android:exported values to all SkQP activities. 2020-08-17 13:33:09 +00:00
resources Reland "Add an SkImageGenerator that uses NDK APIs" 2020-08-05 18:55:30 +00:00
samplecode Componentize SkAudioPlayer 2020-08-14 13:46:06 +00:00
site Describe the Skia 'onMethodName' pattern. 2020-08-14 14:21:28 +00:00
specs Fix CanvasKit generated documentation to work with emscripten 1.39.16. 2020-05-27 12:23:32 +00:00
src Add as<ProgramElementSubclass> to downcast ProgramElements more safely. 2020-08-20 13:48:52 +00:00
tests Reland "Added support for the 'inline' hint on SkSL functions" 2020-08-20 13:42:02 +00:00
third_party Switch Skia's libjpeg-turbo used for testing to Chromium version 2020-08-18 14:08:15 +00:00
tools densify dump_record 2020-08-19 13:35:09 +00:00
.clang-format Disable BinPackParameters in .clang-format 2020-03-27 14:32:40 +00:00
.clang-tidy Enable ClangTidy check readability-redundant-smartptr-get. 2020-08-16 15:56:48 +00:00
.gitignore [infra] Update recipe dependencies 2020-08-03 11:34:57 +00:00
.gn
AUTHORS GCC: fix unknown attribute warnings for no_sanitize 2020-07-06 13:52:22 +00:00
BUILD.gn Revert "remove sksl interpreter guards" 2020-08-20 00:41:15 +00:00
codereview.settings
CONTRIBUTING
CQ_COMMITTERS
DEPS Roll Chromium from ff3c275665f9 to e45f0c4dce5a (503 revisions) 2020-08-20 06:01:08 +00:00
go.mod Update Go Deps 2020-07-25 05:33:32 +00:00
go.sum Update Go Deps 2020-07-25 05:33:32 +00:00
LICENSE LICENSE file: clean up 2019-11-22 21:59:03 +00:00
OWNERS
PRESUBMIT.py PRESUBMIT: Don't check formatting of deleted files 2020-04-08 10:36:09 +00:00
public.bzl Revert "remove sksl interpreter guards" 2020-08-20 00:41:15 +00:00
README
README.chromium
RELEASE_NOTES.txt Add platform image encoder for using NDK APIs 2020-08-13 15:21:41 +00:00
whitespace.txt Whitespace change to re-trigger Mac/iOS tests 2020-02-23 20:55:01 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.