├── .gitattributes
├── .gitignore
├── .idea
├── .gitignore
├── codeStyles
│ ├── Project.xml
│ └── codeStyleConfig.xml
├── compiler.xml
├── gradle.xml
├── jarRepositories.xml
├── misc.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── CMakeLists.txt
├── build.gradle
├── example1.gif
├── example1.jpeg
├── example2.gif
├── example2.jpeg
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── temple
│ │ └── skiaui
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── cpp
│ │ ├── SkiaViewContext.cpp
│ │ ├── SkiaViewContext.h
│ │ ├── anim
│ │ │ ├── AnimatorSet.cpp
│ │ │ ├── AnimatorSet.h
│ │ │ ├── IAnimator.cpp
│ │ │ ├── IAnimator.h
│ │ │ ├── LinearAnimator.cpp
│ │ │ └── LinearAnimator.h
│ │ ├── base
│ │ │ ├── HYScopedLock.h
│ │ │ ├── Looper.cpp
│ │ │ ├── Looper.h
│ │ │ ├── native_log.h
│ │ │ ├── time_utils.cpp
│ │ │ └── time_utils.h
│ │ ├── fliter
│ │ │ ├── IFilter.h
│ │ │ ├── SkiaFilter.cpp
│ │ │ └── SkiaFilter.h
│ │ ├── gl
│ │ │ ├── HYAssetsHolder.h
│ │ │ ├── HYEGLContext.cpp
│ │ │ ├── HYEGLContext.h
│ │ │ ├── HYEGLCore.cpp
│ │ │ ├── HYEGLCore.h
│ │ │ ├── HYEGLRender.cpp
│ │ │ └── HYEGLRender.h
│ │ ├── native-lib.cpp
│ │ ├── plugin
│ │ │ ├── IPlugin.cpp
│ │ │ ├── IPlugin.h
│ │ │ ├── PluginManager.cpp
│ │ │ └── PluginManager.h
│ │ ├── scroll
│ │ │ ├── Scroller.cpp
│ │ │ └── Scroller.h
│ │ ├── test
│ │ │ ├── HYListAdapter.cpp
│ │ │ ├── HYListAdapter.h
│ │ │ ├── HYListView.cpp
│ │ │ ├── HYListView.h
│ │ │ ├── HYRecyclerView.cpp
│ │ │ ├── HYRecyclerView.h
│ │ │ ├── HorizontalDrawTest.cpp
│ │ │ ├── HorizontalDrawTest.h
│ │ │ ├── ITestDraw.h
│ │ │ ├── ImageViewTest.cpp
│ │ │ ├── ImageViewTest.h
│ │ │ ├── ListViewTest.cpp
│ │ │ ├── ListViewTest.h
│ │ │ ├── MovingDrawTest.cpp
│ │ │ ├── MovingDrawTest.h
│ │ │ ├── PercentViewTest.cpp
│ │ │ ├── PercentViewTest.h
│ │ │ ├── ProgressBarDrawTest.cpp
│ │ │ ├── ProgressBarDrawTest.h
│ │ │ ├── ScrollViewTest.cpp
│ │ │ ├── ScrollViewTest.h
│ │ │ ├── TextViewTest.cpp
│ │ │ ├── TextViewTest.h
│ │ │ ├── VerticalDrawTest.cpp
│ │ │ └── VerticalDrawTest.h
│ │ ├── touch
│ │ │ ├── ScrollDispatcher.cpp
│ │ │ ├── ScrollDispatcher.h
│ │ │ ├── TouchEvent.h
│ │ │ ├── TouchEventDispatcher.cpp
│ │ │ ├── TouchEventDispatcher.h
│ │ │ └── Velocity.h
│ │ ├── widget
│ │ │ ├── BaseListAdapter.h
│ │ │ ├── BaseListView.h
│ │ │ ├── Button.cpp
│ │ │ ├── Button.h
│ │ │ ├── FlexboxLayout.cpp
│ │ │ ├── FlexboxLayout.h
│ │ │ ├── ImageView.cpp
│ │ │ ├── ImageView.h
│ │ │ ├── LayoutParams.cpp
│ │ │ ├── LayoutParams.h
│ │ │ ├── MeasureSpec.h
│ │ │ ├── MovingView.cpp
│ │ │ ├── MovingView.h
│ │ │ ├── ProgressBar.cpp
│ │ │ ├── ProgressBar.h
│ │ │ ├── RecyclerView.h
│ │ │ ├── RecyclerViewAdapter.h
│ │ │ ├── RecyclerViewHolder.h
│ │ │ ├── ScrollView.cpp
│ │ │ ├── ScrollView.h
│ │ │ ├── TextView.cpp
│ │ │ ├── TextView.h
│ │ │ ├── View.cpp
│ │ │ ├── View.h
│ │ │ ├── ViewGroup.cpp
│ │ │ └── ViewGroup.h
│ │ └── yoga
│ │ │ ├── BitUtils.h
│ │ │ ├── CompactValue.h
│ │ │ ├── Utils.cpp
│ │ │ ├── Utils.h
│ │ │ ├── YGConfig.cpp
│ │ │ ├── YGConfig.h
│ │ │ ├── YGEnums.cpp
│ │ │ ├── YGEnums.h
│ │ │ ├── YGFloatOptional.h
│ │ │ ├── YGLayout.cpp
│ │ │ ├── YGLayout.h
│ │ │ ├── YGMacros.h
│ │ │ ├── YGNode.cpp
│ │ │ ├── YGNode.h
│ │ │ ├── YGNodePrint.cpp
│ │ │ ├── YGNodePrint.h
│ │ │ ├── YGStyle.cpp
│ │ │ ├── YGStyle.h
│ │ │ ├── YGValue.cpp
│ │ │ ├── YGValue.h
│ │ │ ├── Yoga-internal.h
│ │ │ ├── Yoga.cpp
│ │ │ ├── Yoga.h
│ │ │ ├── event
│ │ │ ├── event.cpp
│ │ │ └── event.h
│ │ │ ├── internal
│ │ │ ├── experiments-inl.h
│ │ │ ├── experiments.cpp
│ │ │ └── experiments.h
│ │ │ ├── log.cpp
│ │ │ └── log.h
│ ├── java
│ │ └── com
│ │ │ └── temple
│ │ │ └── skiaui
│ │ │ ├── HYSkiaEngine.kt
│ │ │ ├── HYSkiaSurfaceView.kt
│ │ │ ├── HYSkiaTextureView.kt
│ │ │ ├── MainActivity.kt
│ │ │ └── RenderMode.kt
│ ├── jniLibs
│ │ ├── arm64-v8a
│ │ │ ├── libfreetype2.a
│ │ │ ├── libharfbuzz.a
│ │ │ ├── libicu.a
│ │ │ ├── libskcms.a
│ │ │ ├── libskia.a
│ │ │ ├── libskparagraph.a
│ │ │ ├── libskresources.a
│ │ │ ├── libskshaper.a
│ │ │ ├── libskunicode.a
│ │ │ └── libsvg.a
│ │ └── skia
│ │ │ ├── include
│ │ │ ├── android
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── SkAndroidFrameworkUtils.h
│ │ │ │ └── SkAnimatedImage.h
│ │ │ ├── c
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── sk_canvas.h
│ │ │ │ ├── sk_colorspace.h
│ │ │ │ ├── sk_data.h
│ │ │ │ ├── sk_image.h
│ │ │ │ ├── sk_imageinfo.h
│ │ │ │ ├── sk_maskfilter.h
│ │ │ │ ├── sk_matrix.h
│ │ │ │ ├── sk_paint.h
│ │ │ │ ├── sk_path.h
│ │ │ │ ├── sk_picture.h
│ │ │ │ ├── sk_shader.h
│ │ │ │ ├── sk_surface.h
│ │ │ │ └── sk_types.h
│ │ │ ├── codec
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── SkAndroidCodec.h
│ │ │ │ ├── SkCodec.h
│ │ │ │ ├── SkCodecAnimation.h
│ │ │ │ └── SkEncodedOrigin.h
│ │ │ ├── config
│ │ │ │ ├── BUILD.bazel
│ │ │ │ └── SkUserConfig.h
│ │ │ ├── core
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── SkAlphaType.h
│ │ │ │ ├── SkAnnotation.h
│ │ │ │ ├── SkBBHFactory.h
│ │ │ │ ├── SkBitmap.h
│ │ │ │ ├── SkBlendMode.h
│ │ │ │ ├── SkBlender.h
│ │ │ │ ├── SkBlurTypes.h
│ │ │ │ ├── SkCanvas.h
│ │ │ │ ├── SkCanvasVirtualEnforcer.h
│ │ │ │ ├── SkCapabilities.h
│ │ │ │ ├── SkClipOp.h
│ │ │ │ ├── SkColor.h
│ │ │ │ ├── SkColorFilter.h
│ │ │ │ ├── SkColorPriv.h
│ │ │ │ ├── SkColorSpace.h
│ │ │ │ ├── SkColorType.h
│ │ │ │ ├── SkCombinationBuilder.h
│ │ │ │ ├── SkContourMeasure.h
│ │ │ │ ├── SkCoverageMode.h
│ │ │ │ ├── SkCubicMap.h
│ │ │ │ ├── SkData.h
│ │ │ │ ├── SkDataTable.h
│ │ │ │ ├── SkDeferredDisplayList.h
│ │ │ │ ├── SkDeferredDisplayListRecorder.h
│ │ │ │ ├── SkDocument.h
│ │ │ │ ├── SkDrawLooper.h
│ │ │ │ ├── SkDrawable.h
│ │ │ │ ├── SkEncodedImageFormat.h
│ │ │ │ ├── SkExecutor.h
│ │ │ │ ├── SkFlattenable.h
│ │ │ │ ├── SkFont.h
│ │ │ │ ├── SkFontArguments.h
│ │ │ │ ├── SkFontMetrics.h
│ │ │ │ ├── SkFontMgr.h
│ │ │ │ ├── SkFontParameters.h
│ │ │ │ ├── SkFontStyle.h
│ │ │ │ ├── SkFontTypes.h
│ │ │ │ ├── SkGraphics.h
│ │ │ │ ├── SkICC.h
│ │ │ │ ├── SkImage.h
│ │ │ │ ├── SkImageEncoder.h
│ │ │ │ ├── SkImageFilter.h
│ │ │ │ ├── SkImageGenerator.h
│ │ │ │ ├── SkImageInfo.h
│ │ │ │ ├── SkLRUCache.h
│ │ │ │ ├── SkM44.h
│ │ │ │ ├── SkMallocPixelRef.h
│ │ │ │ ├── SkMaskFilter.h
│ │ │ │ ├── SkMath.h
│ │ │ │ ├── SkMatrix.h
│ │ │ │ ├── SkMesh.h
│ │ │ │ ├── SkMilestone.h
│ │ │ │ ├── SkOpenTypeSVGDecoder.h
│ │ │ │ ├── SkOverdrawCanvas.h
│ │ │ │ ├── SkPaint.h
│ │ │ │ ├── SkPath.h
│ │ │ │ ├── SkPathBuilder.h
│ │ │ │ ├── SkPathEffect.h
│ │ │ │ ├── SkPathMeasure.h
│ │ │ │ ├── SkPathTypes.h
│ │ │ │ ├── SkPicture.h
│ │ │ │ ├── SkPictureRecorder.h
│ │ │ │ ├── SkPixelRef.h
│ │ │ │ ├── SkPixmap.h
│ │ │ │ ├── SkPngChunkReader.h
│ │ │ │ ├── SkPoint.h
│ │ │ │ ├── SkPoint3.h
│ │ │ │ ├── SkPromiseImageTexture.h
│ │ │ │ ├── SkRRect.h
│ │ │ │ ├── SkRSXform.h
│ │ │ │ ├── SkRasterHandleAllocator.h
│ │ │ │ ├── SkRect.h
│ │ │ │ ├── SkRefCnt.h
│ │ │ │ ├── SkRegion.h
│ │ │ │ ├── SkSamplingOptions.h
│ │ │ │ ├── SkScalar.h
│ │ │ │ ├── SkSerialProcs.h
│ │ │ │ ├── SkShader.h
│ │ │ │ ├── SkSize.h
│ │ │ │ ├── SkSpan.h
│ │ │ │ ├── SkStream.h
│ │ │ │ ├── SkString.h
│ │ │ │ ├── SkStrokeRec.h
│ │ │ │ ├── SkSurface.h
│ │ │ │ ├── SkSurfaceCharacterization.h
│ │ │ │ ├── SkSurfaceProps.h
│ │ │ │ ├── SkSwizzle.h
│ │ │ │ ├── SkTInternalLList.h
│ │ │ │ ├── SkTextBlob.h
│ │ │ │ ├── SkTileMode.h
│ │ │ │ ├── SkTime.h
│ │ │ │ ├── SkTraceMemoryDump.h
│ │ │ │ ├── SkTypeface.h
│ │ │ │ ├── SkTypes.h
│ │ │ │ ├── SkUnPreMultiply.h
│ │ │ │ ├── SkVertices.h
│ │ │ │ ├── SkYUVAInfo.h
│ │ │ │ └── SkYUVAPixmaps.h
│ │ │ ├── docs
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── SkPDFDocument.h
│ │ │ │ └── SkXPSDocument.h
│ │ │ ├── effects
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── Sk1DPathEffect.h
│ │ │ │ ├── Sk2DPathEffect.h
│ │ │ │ ├── SkBlenders.h
│ │ │ │ ├── SkBlurDrawLooper.h
│ │ │ │ ├── SkBlurMaskFilter.h
│ │ │ │ ├── SkColorMatrix.h
│ │ │ │ ├── SkColorMatrixFilter.h
│ │ │ │ ├── SkCornerPathEffect.h
│ │ │ │ ├── SkDashPathEffect.h
│ │ │ │ ├── SkDiscretePathEffect.h
│ │ │ │ ├── SkGradientShader.h
│ │ │ │ ├── SkHighContrastFilter.h
│ │ │ │ ├── SkImageFilters.h
│ │ │ │ ├── SkLayerDrawLooper.h
│ │ │ │ ├── SkLumaColorFilter.h
│ │ │ │ ├── SkOpPathEffect.h
│ │ │ │ ├── SkOverdrawColorFilter.h
│ │ │ │ ├── SkPerlinNoiseShader.h
│ │ │ │ ├── SkRuntimeEffect.h
│ │ │ │ ├── SkShaderMaskFilter.h
│ │ │ │ ├── SkStrokeAndFillPathEffect.h
│ │ │ │ ├── SkTableColorFilter.h
│ │ │ │ ├── SkTableMaskFilter.h
│ │ │ │ └── SkTrimPathEffect.h
│ │ │ ├── encode
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── SkEncoder.h
│ │ │ │ ├── SkJpegEncoder.h
│ │ │ │ ├── SkPngEncoder.h
│ │ │ │ └── SkWebpEncoder.h
│ │ │ ├── gpu
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── GpuTypes.h
│ │ │ │ ├── GrBackendDrawableInfo.h
│ │ │ │ ├── GrBackendSemaphore.h
│ │ │ │ ├── GrBackendSurface.h
│ │ │ │ ├── GrBackendSurfaceMutableState.h
│ │ │ │ ├── GrConfig.h
│ │ │ │ ├── GrContextOptions.h
│ │ │ │ ├── GrContextThreadSafeProxy.h
│ │ │ │ ├── GrDirectContext.h
│ │ │ │ ├── GrDriverBugWorkarounds.h
│ │ │ │ ├── GrDriverBugWorkaroundsAutogen.h
│ │ │ │ ├── GrRecordingContext.h
│ │ │ │ ├── GrSurfaceInfo.h
│ │ │ │ ├── GrTypes.h
│ │ │ │ ├── GrYUVABackendTextures.h
│ │ │ │ ├── ShaderErrorHandler.h
│ │ │ │ ├── d3d
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── GrD3DBackendContext.h
│ │ │ │ │ └── GrD3DTypes.h
│ │ │ │ ├── dawn
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ └── GrDawnTypes.h
│ │ │ │ ├── gl
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── GrGLAssembleHelpers.h
│ │ │ │ │ ├── GrGLAssembleInterface.h
│ │ │ │ │ ├── GrGLConfig.h
│ │ │ │ │ ├── GrGLConfig_chrome.h
│ │ │ │ │ ├── GrGLExtensions.h
│ │ │ │ │ ├── GrGLFunctions.h
│ │ │ │ │ ├── GrGLInterface.h
│ │ │ │ │ ├── GrGLTypes.h
│ │ │ │ │ ├── egl
│ │ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ │ └── GrGLMakeEGLInterface.h
│ │ │ │ │ └── glx
│ │ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ │ └── GrGLMakeGLXInterface.h
│ │ │ │ ├── graphite
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── BackendTexture.h
│ │ │ │ │ ├── Context.h
│ │ │ │ │ ├── ContextOptions.h
│ │ │ │ │ ├── GraphiteTypes.h
│ │ │ │ │ ├── Recorder.h
│ │ │ │ │ ├── Recording.h
│ │ │ │ │ ├── SkStuff.h
│ │ │ │ │ ├── TextureInfo.h
│ │ │ │ │ └── mtl
│ │ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ │ ├── MtlBackendContext.h
│ │ │ │ │ │ └── MtlTypes.h
│ │ │ │ ├── mock
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ └── GrMockTypes.h
│ │ │ │ ├── mtl
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── GrMtlBackendContext.h
│ │ │ │ │ └── GrMtlTypes.h
│ │ │ │ └── vk
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── GrVkBackendContext.h
│ │ │ │ │ ├── GrVkExtensions.h
│ │ │ │ │ ├── GrVkMemoryAllocator.h
│ │ │ │ │ ├── GrVkTypes.h
│ │ │ │ │ └── GrVkVulkan.h
│ │ │ ├── pathops
│ │ │ │ ├── BUILD.bazel
│ │ │ │ └── SkPathOps.h
│ │ │ ├── ports
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── SkCFObject.h
│ │ │ │ ├── SkFontConfigInterface.h
│ │ │ │ ├── SkFontMgr_FontConfigInterface.h
│ │ │ │ ├── SkFontMgr_android.h
│ │ │ │ ├── SkFontMgr_directory.h
│ │ │ │ ├── SkFontMgr_empty.h
│ │ │ │ ├── SkFontMgr_fontconfig.h
│ │ │ │ ├── SkFontMgr_fuchsia.h
│ │ │ │ ├── SkFontMgr_indirect.h
│ │ │ │ ├── SkFontMgr_mac_ct.h
│ │ │ │ ├── SkImageGeneratorCG.h
│ │ │ │ ├── SkImageGeneratorNDK.h
│ │ │ │ ├── SkImageGeneratorWIC.h
│ │ │ │ ├── SkRemotableFontMgr.h
│ │ │ │ ├── SkTypeface_mac.h
│ │ │ │ └── SkTypeface_win.h
│ │ │ ├── private
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── OWNERS
│ │ │ │ ├── SingleOwner.h
│ │ │ │ ├── SkBitmaskEnum.h
│ │ │ │ ├── SkChecksum.h
│ │ │ │ ├── SkColorData.h
│ │ │ │ ├── SkDeque.h
│ │ │ │ ├── SkEncodedInfo.h
│ │ │ │ ├── SkFixed.h
│ │ │ │ ├── SkFloatBits.h
│ │ │ │ ├── SkFloatingPoint.h
│ │ │ │ ├── SkHalf.h
│ │ │ │ ├── SkIDChangeListener.h
│ │ │ │ ├── SkImageInfoPriv.h
│ │ │ │ ├── SkMacros.h
│ │ │ │ ├── SkMalloc.h
│ │ │ │ ├── SkMutex.h
│ │ │ │ ├── SkNoncopyable.h
│ │ │ │ ├── SkOnce.h
│ │ │ │ ├── SkOpts_spi.h
│ │ │ │ ├── SkPathRef.h
│ │ │ │ ├── SkSLDefines.h
│ │ │ │ ├── SkSLIRNode.h
│ │ │ │ ├── SkSLLayout.h
│ │ │ │ ├── SkSLModifiers.h
│ │ │ │ ├── SkSLProgramElement.h
│ │ │ │ ├── SkSLProgramKind.h
│ │ │ │ ├── SkSLSampleUsage.h
│ │ │ │ ├── SkSLStatement.h
│ │ │ │ ├── SkSLString.h
│ │ │ │ ├── SkSLSymbol.h
│ │ │ │ ├── SkSafe32.h
│ │ │ │ ├── SkSafe_math.h
│ │ │ │ ├── SkSemaphore.h
│ │ │ │ ├── SkShadowFlags.h
│ │ │ │ ├── SkSpinlock.h
│ │ │ │ ├── SkStringView.h
│ │ │ │ ├── SkTArray.h
│ │ │ │ ├── SkTDArray.h
│ │ │ │ ├── SkTFitsIn.h
│ │ │ │ ├── SkTHash.h
│ │ │ │ ├── SkTLogic.h
│ │ │ │ ├── SkTPin.h
│ │ │ │ ├── SkTemplates.h
│ │ │ │ ├── SkThreadAnnotations.h
│ │ │ │ ├── SkThreadID.h
│ │ │ │ ├── SkTo.h
│ │ │ │ ├── SkUniquePaintParamsID.h
│ │ │ │ ├── SkVx.h
│ │ │ │ ├── SkWeakRefCnt.h
│ │ │ │ ├── chromium
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── GrSlug.h
│ │ │ │ │ ├── SkChromeRemoteGlyphCache.h
│ │ │ │ │ └── Slug.h
│ │ │ │ └── gpu
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── ganesh
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── GrContext_Base.h
│ │ │ │ │ ├── GrD3DTypesMinimal.h
│ │ │ │ │ ├── GrDawnTypesPriv.h
│ │ │ │ │ ├── GrGLTypesPriv.h
│ │ │ │ │ ├── GrImageContext.h
│ │ │ │ │ ├── GrMockTypesPriv.h
│ │ │ │ │ ├── GrMtlTypesPriv.h
│ │ │ │ │ ├── GrTypesPriv.h
│ │ │ │ │ └── GrVkTypesPriv.h
│ │ │ │ │ └── graphite
│ │ │ │ │ └── MtlTypesPriv.h
│ │ │ ├── sksl
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── DSL.h
│ │ │ │ ├── DSLBlock.h
│ │ │ │ ├── DSLCase.h
│ │ │ │ ├── DSLCore.h
│ │ │ │ ├── DSLExpression.h
│ │ │ │ ├── DSLFunction.h
│ │ │ │ ├── DSLLayout.h
│ │ │ │ ├── DSLModifiers.h
│ │ │ │ ├── DSLStatement.h
│ │ │ │ ├── DSLSymbols.h
│ │ │ │ ├── DSLType.h
│ │ │ │ ├── DSLVar.h
│ │ │ │ ├── OWNERS
│ │ │ │ ├── SkSLDebugTrace.h
│ │ │ │ ├── SkSLErrorReporter.h
│ │ │ │ ├── SkSLOperator.h
│ │ │ │ ├── SkSLPosition.h
│ │ │ │ └── SkSLVersion.h
│ │ │ ├── svg
│ │ │ │ ├── BUILD.bazel
│ │ │ │ └── SkSVGCanvas.h
│ │ │ ├── third_party
│ │ │ │ ├── skcms
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── OWNERS
│ │ │ │ │ └── skcms.h
│ │ │ │ └── vulkan
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ └── vulkan
│ │ │ │ │ ├── vk_platform.h
│ │ │ │ │ ├── vulkan.h
│ │ │ │ │ ├── vulkan_android.h
│ │ │ │ │ ├── vulkan_core.h
│ │ │ │ │ ├── vulkan_ios.h
│ │ │ │ │ ├── vulkan_macos.h
│ │ │ │ │ ├── vulkan_win32.h
│ │ │ │ │ └── vulkan_xcb.h
│ │ │ └── utils
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── SkAnimCodecPlayer.h
│ │ │ │ ├── SkBase64.h
│ │ │ │ ├── SkCamera.h
│ │ │ │ ├── SkCanvasStateUtils.h
│ │ │ │ ├── SkCustomTypeface.h
│ │ │ │ ├── SkEventTracer.h
│ │ │ │ ├── SkNWayCanvas.h
│ │ │ │ ├── SkNoDrawCanvas.h
│ │ │ │ ├── SkNullCanvas.h
│ │ │ │ ├── SkOrderedFontMgr.h
│ │ │ │ ├── SkPaintFilterCanvas.h
│ │ │ │ ├── SkParse.h
│ │ │ │ ├── SkParsePath.h
│ │ │ │ ├── SkRandom.h
│ │ │ │ ├── SkShadowUtils.h
│ │ │ │ ├── SkTextUtils.h
│ │ │ │ ├── SkTraceEventPhase.h
│ │ │ │ ├── SkUTF.h
│ │ │ │ └── mac
│ │ │ │ ├── BUILD.bazel
│ │ │ │ └── SkCGUtils.h
│ │ │ ├── modules
│ │ │ ├── skcms
│ │ │ │ ├── skcms.h
│ │ │ │ ├── skcms_internal.h
│ │ │ │ └── src
│ │ │ │ │ └── Transform_inl.h
│ │ │ ├── skparagraph
│ │ │ │ └── include
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── DartTypes.h
│ │ │ │ │ ├── FontArguments.h
│ │ │ │ │ ├── FontCollection.h
│ │ │ │ │ ├── Metrics.h
│ │ │ │ │ ├── Paragraph.h
│ │ │ │ │ ├── ParagraphBuilder.h
│ │ │ │ │ ├── ParagraphBuilderImpl.h
│ │ │ │ │ ├── ParagraphCache.h
│ │ │ │ │ ├── ParagraphStyle.h
│ │ │ │ │ ├── TextShadow.h
│ │ │ │ │ ├── TextStyle.h
│ │ │ │ │ └── TypefaceFontProvider.h
│ │ │ ├── skresources
│ │ │ │ └── include
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ └── SkResources.h
│ │ │ ├── sksg
│ │ │ │ └── include
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ ├── SkSGClipEffect.h
│ │ │ │ │ ├── SkSGColorFilter.h
│ │ │ │ │ ├── SkSGDraw.h
│ │ │ │ │ ├── SkSGEffectNode.h
│ │ │ │ │ ├── SkSGGeometryEffect.h
│ │ │ │ │ ├── SkSGGeometryNode.h
│ │ │ │ │ ├── SkSGGradient.h
│ │ │ │ │ ├── SkSGGroup.h
│ │ │ │ │ ├── SkSGImage.h
│ │ │ │ │ ├── SkSGInvalidationController.h
│ │ │ │ │ ├── SkSGMaskEffect.h
│ │ │ │ │ ├── SkSGMerge.h
│ │ │ │ │ ├── SkSGNode.h
│ │ │ │ │ ├── SkSGOpacityEffect.h
│ │ │ │ │ ├── SkSGPaint.h
│ │ │ │ │ ├── SkSGPath.h
│ │ │ │ │ ├── SkSGPlane.h
│ │ │ │ │ ├── SkSGRect.h
│ │ │ │ │ ├── SkSGRenderEffect.h
│ │ │ │ │ ├── SkSGRenderNode.h
│ │ │ │ │ ├── SkSGScene.h
│ │ │ │ │ ├── SkSGText.h
│ │ │ │ │ └── SkSGTransform.h
│ │ │ ├── skunicode
│ │ │ │ └── include
│ │ │ │ │ ├── BUILD.bazel
│ │ │ │ │ └── SkUnicode.h
│ │ │ └── svg
│ │ │ │ └── include
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── SkSVGAttribute.h
│ │ │ │ ├── SkSVGAttributeParser.h
│ │ │ │ ├── SkSVGCircle.h
│ │ │ │ ├── SkSVGClipPath.h
│ │ │ │ ├── SkSVGContainer.h
│ │ │ │ ├── SkSVGDOM.h
│ │ │ │ ├── SkSVGDefs.h
│ │ │ │ ├── SkSVGEllipse.h
│ │ │ │ ├── SkSVGFe.h
│ │ │ │ ├── SkSVGFeBlend.h
│ │ │ │ ├── SkSVGFeColorMatrix.h
│ │ │ │ ├── SkSVGFeComposite.h
│ │ │ │ ├── SkSVGFeDisplacementMap.h
│ │ │ │ ├── SkSVGFeFlood.h
│ │ │ │ ├── SkSVGFeGaussianBlur.h
│ │ │ │ ├── SkSVGFeImage.h
│ │ │ │ ├── SkSVGFeLightSource.h
│ │ │ │ ├── SkSVGFeLighting.h
│ │ │ │ ├── SkSVGFeMorphology.h
│ │ │ │ ├── SkSVGFeOffset.h
│ │ │ │ ├── SkSVGFeTurbulence.h
│ │ │ │ ├── SkSVGFilter.h
│ │ │ │ ├── SkSVGFilterContext.h
│ │ │ │ ├── SkSVGG.h
│ │ │ │ ├── SkSVGGradient.h
│ │ │ │ ├── SkSVGHiddenContainer.h
│ │ │ │ ├── SkSVGIDMapper.h
│ │ │ │ ├── SkSVGImage.h
│ │ │ │ ├── SkSVGLine.h
│ │ │ │ ├── SkSVGLinearGradient.h
│ │ │ │ ├── SkSVGMask.h
│ │ │ │ ├── SkSVGNode.h
│ │ │ │ ├── SkSVGOpenTypeSVGDecoder.h
│ │ │ │ ├── SkSVGPath.h
│ │ │ │ ├── SkSVGPattern.h
│ │ │ │ ├── SkSVGPoly.h
│ │ │ │ ├── SkSVGRadialGradient.h
│ │ │ │ ├── SkSVGRect.h
│ │ │ │ ├── SkSVGRenderContext.h
│ │ │ │ ├── SkSVGSVG.h
│ │ │ │ ├── SkSVGShape.h
│ │ │ │ ├── SkSVGStop.h
│ │ │ │ ├── SkSVGText.h
│ │ │ │ ├── SkSVGTransformableNode.h
│ │ │ │ ├── SkSVGTypes.h
│ │ │ │ ├── SkSVGUse.h
│ │ │ │ └── SkSVGValue.h
│ │ │ └── readme.txt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── temple
│ └── skiaui
│ └── ExampleUnitTest.kt
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitattributes:
--------------------------------------------------------------------------------
1 | app/src/main/jniLibs/arm64-v8a/libskia.a filter=lfs diff=lfs merge=lfs -text
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | # IntelliJ
5 | /.idea/
6 | /.idea/*
7 | /.idea/caches
8 | /.idea/libraries
9 | /.idea/modules.xml
10 | /.idea/workspace.xml
11 | /.idea/navEditor.xml
12 | /.idea/assetWizardSettings.xml
13 | /.idea/vcs.xml
14 | .DS_Store
15 | /build
16 | /captures
17 | .externalNativeBuild
18 | .cxx
19 | local.properties
20 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
19 |
20 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SkiaUI
2 |
3 | plse refer https://github.com/tanpuer/SkiaUI2, this repo will never update.
4 |
5 |
6 | switch to branch develop
7 |
8 | Using Skia, Yoga, SurfaceView/TextureView to build a simple Flexbox-UI framework for Android.
9 |
10 | 步骤:
11 | 1. import Skia and Yoga。
12 | skia: https://skia.org/docs/user/build/
13 | Yoga: using directly with source code。
14 | 2. 配置好gl环境,使用Skia硬件加速。
15 | 3. 绘制模仿安卓Measure/Layout/Draw三板斧流程,只支持Flexbox布局。
16 | 4. 事件分发大体模仿安卓dispatchTouchEvent/interceptTouchEvent/onTouchEvent等,做了简化处理。
17 | 5. 动画支持scale/rotate/translate,在layout阶段更新SKMatrix,从而更新绘制的矩形。
18 | 6. 目前只支持View/TextView/ImageView/ProgressBar/FlexboxLayout/ScrollView
19 | View矩形。
20 | ImageView支持了scaleType,圆角。
21 | TextView接入SkParagraph。后续想用这套试试富文本编辑器;
22 | ProgressBar支持圆形和直线形,可拖拽修改进度。
23 | 7. scrollView实现,滑动,fling,目前滑动效果过于僵硬,todo 优化滑动效果。
24 | 8. todo 脏区渲染
25 | 9. 实现RecyclerView,adapter,ViewHolder复用机制,目前快速滑动有问题。
26 |
27 | 
28 | 
29 | 
30 | 
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/example1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/example1.gif
--------------------------------------------------------------------------------
/app/example1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/example1.jpeg
--------------------------------------------------------------------------------
/app/example2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/example2.gif
--------------------------------------------------------------------------------
/app/example2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/example2.jpeg
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/temple/skiaui/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.temple.skiaui
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.temple.skiaui", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/cpp/SkiaViewContext.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 1/21/22.
3 | //
4 |
5 | #include "SkiaViewContext.h"
6 |
7 | SkiaViewContext::SkiaViewContext(ANativeWindow *nativeWindow) {
8 | glContext = new HYEGLContext(HYAssetsHolder::get().javaVm);
9 | glContext->sendMessage(glContext->kMsgTempleInit);
10 | glContext->sendMessage(glContext->kMsgSurfaceOnCreate, nativeWindow);
11 | }
12 |
13 | SkiaViewContext::~SkiaViewContext() {
14 | if (glContext != nullptr) {
15 | glContext->sendMessage(glContext->kMsgSurfaceOnDestroy);
16 | }
17 | }
18 |
19 | void SkiaViewContext::sizeChanged(int width, int height) {
20 | if (glContext != nullptr) {
21 | glContext->sendMessage(glContext->kMsgSurfaceSizeChanged, width, height);
22 | }
23 | }
24 |
25 | void SkiaViewContext::doFrame(long time) {
26 | if (glContext != nullptr) {
27 | glContext->sendMessage(glContext->kMsgDoFrame, (void *) time);
28 | }
29 | }
30 |
31 | void SkiaViewContext::dispatchTouchEvent(TouchEvent *touchEvent) {
32 | if (glContext != nullptr) {
33 | glContext->sendMessage(glContext->kMsgTouchEvent, touchEvent);
34 | }
35 | }
36 |
37 | void SkiaViewContext::setVelocity(float x, float y) {
38 | if (glContext != nullptr) {
39 | glContext->sendMessage(glContext->kMsgTouchVelocity, (void *) (new Velocity(x, y)));
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/cpp/SkiaViewContext.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 1/21/22.
3 | //
4 |
5 | #ifndef SKIAUI_SKIAVIEWCONTEXT_H
6 | #define SKIAUI_SKIAVIEWCONTEXT_H
7 |
8 | #include
9 | #include
10 | #include "android/native_window_jni.h"
11 | #include "TouchEvent.h"
12 |
13 | class SkiaViewContext {
14 |
15 | public:
16 |
17 | SkiaViewContext(ANativeWindow *nativeWindow);
18 |
19 | ~SkiaViewContext();
20 |
21 | void sizeChanged(int width, int height);
22 |
23 | void doFrame(long time);
24 |
25 | void dispatchTouchEvent(TouchEvent *touchEvent);
26 |
27 | void setVelocity(float x, float y);
28 |
29 | private:
30 |
31 | HYEGLContext *glContext;
32 |
33 | };
34 |
35 |
36 | #endif //SKIAUI_SKIAVIEWCONTEXT_H
37 |
--------------------------------------------------------------------------------
/app/src/main/cpp/anim/AnimatorSet.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/6/24.
3 | //
4 |
5 | #include "AnimatorSet.h"
6 | #include "core/SkMatrix.h"
7 |
8 | AnimatorSet::AnimatorSet() {
9 |
10 | }
11 |
12 | AnimatorSet::~AnimatorSet() {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/cpp/anim/AnimatorSet.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/6/24.
3 | //
4 |
5 | #ifndef SKIAUI_ANIMATORSET_H
6 | #define SKIAUI_ANIMATORSET_H
7 |
8 | class AnimatorSet {
9 |
10 | public:
11 |
12 | AnimatorSet();
13 |
14 | virtual ~AnimatorSet();
15 |
16 | private:
17 |
18 | bool canScale, canRotate, canTranslate;
19 |
20 | };
21 |
22 |
23 | #endif //SKIAUI_ANIMATORSET_H
24 |
--------------------------------------------------------------------------------
/app/src/main/cpp/anim/IAnimator.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/6/23.
3 | //
4 |
5 | #include "IAnimator.h"
6 |
7 | long IAnimator::currTime = 0L;
8 |
9 | IAnimator::IAnimator() : duration(500L), end(true), startTime(-1L), endTime(-1) {
10 | }
11 |
12 | IAnimator::~IAnimator() {
13 |
14 | }
15 |
16 | void IAnimator::setDuration(long duration) {
17 | this->duration = duration;
18 | }
19 |
20 | void IAnimator::start() {
21 | end = false;
22 | startTime = currTime;
23 | endTime = currTime + duration;
24 | }
25 |
26 | bool IAnimator::isEnd() {
27 | return end;
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/cpp/anim/IAnimator.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/6/23.
3 | //
4 |
5 | #ifndef SKIAUI_IANIMATOR_H
6 | #define SKIAUI_IANIMATOR_H
7 |
8 | #include "functional"
9 | #include "core/SkRect.h"
10 |
11 | class IAnimator {
12 |
13 | public:
14 |
15 | /**
16 | * 每画一帧,会记录当前的时间戳,其他动画或者变化可参考此时间
17 | */
18 | static long currTime;
19 |
20 | public:
21 |
22 | IAnimator();
23 |
24 | virtual ~IAnimator();
25 |
26 | virtual float getInterpolation(float factor) = 0;
27 |
28 | virtual void setDuration(long duration);
29 |
30 | virtual void start();
31 |
32 | virtual bool isEnd();
33 |
34 | virtual void update(SkIRect &rect) = 0;
35 |
36 | protected:
37 |
38 | long duration;
39 |
40 | long startTime, endTime;
41 |
42 | bool end;
43 |
44 | std::function animatorCallback;
45 |
46 | };
47 |
48 |
49 | #endif //SKIAUI_IANIMATOR_H
--------------------------------------------------------------------------------
/app/src/main/cpp/anim/LinearAnimator.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/6/23.
3 | //
4 |
5 | #ifndef SKIAUI_LINEARANIMATOR_H
6 | #define SKIAUI_LINEARANIMATOR_H
7 |
8 |
9 | #include "IAnimator.h"
10 | #include "core/SkMatrix.h"
11 |
12 | class LinearAnimator : public IAnimator {
13 |
14 | public:
15 |
16 | enum class AnimatorType {
17 | Scale,
18 | Rotate,
19 | Translate,
20 | };
21 |
22 | public:
23 |
24 | LinearAnimator(float translateX, float translateY);
25 |
26 | virtual ~LinearAnimator();
27 |
28 | virtual float getInterpolation(float factor) override;
29 |
30 | void update(SkIRect &rect) override;
31 |
32 | private:
33 |
34 | float translateX, translateY;
35 |
36 | float startRotate, endRotate;
37 |
38 | SkRect dst, src;
39 |
40 | SkMatrix m, translateMatrix, rotateMatrix, scaleMatrix;
41 |
42 | };
43 |
44 |
45 | #endif //SKIAUI_LINEARANIMATOR_H
46 |
--------------------------------------------------------------------------------
/app/src/main/cpp/base/Looper.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by templechen on 2019/3/15.
3 | //
4 |
5 | #ifndef VIDEOSHADERDEMO_LOOPER_H
6 | #define VIDEOSHADERDEMO_LOOPER_H
7 |
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | class Looper {
14 |
15 | public:
16 | struct LooperMessage {
17 | int what;
18 | int arg1;
19 | int arg2;
20 | void *obj;
21 | LooperMessage *next;
22 | bool quit;
23 | };
24 |
25 | public:
26 |
27 | Looper();
28 |
29 | Looper(JavaVM *jvm);
30 |
31 | virtual ~Looper();
32 |
33 | void sendMessage(int what);
34 |
35 | void sendMessage(int what, void *obj);
36 |
37 | void sendMessage(int what, int arg1, int arg2);
38 |
39 | void sendMessage(int what, int arg1, int arg2, void *obj);
40 |
41 | virtual void handleMessage(LooperMessage *msg);
42 |
43 | void quit();
44 |
45 | virtual void pthreadExit();
46 |
47 | int quitMessage = -100;
48 |
49 | protected:
50 |
51 | JNIEnv *env;
52 |
53 | JavaVM *jvm;
54 |
55 | private:
56 |
57 | void initThread();
58 |
59 | void addMessage(LooperMessage *msg);
60 |
61 | static void *trampoline(void *p);
62 |
63 | void loop();
64 |
65 | pthread_t worker_thread;
66 | sem_t headwriteprotect;
67 | sem_t headdataavailable;
68 |
69 | LooperMessage *head;
70 |
71 | bool running;
72 |
73 | };
74 |
75 |
76 | #endif //VIDEOSHADERDEMO_LOOPER_H
77 |
--------------------------------------------------------------------------------
/app/src/main/cpp/base/native_log.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by templechen on 2019/2/24.
3 | //
4 |
5 | #ifndef AUDIOEFFECTDEMO_NATIVE_LOG_H
6 | #define AUDIOEFFECTDEMO_NATIVE_LOG_H
7 |
8 | #include
9 |
10 | #define Android 1
11 | #define JNI_DEBUG 1
12 | #define JNI_TAG "SkiaUI"
13 |
14 | #ifdef Android
15 | #define ALOGE(format, ...) if (JNI_DEBUG) { __android_log_print(ANDROID_LOG_ERROR, JNI_TAG, format, ##__VA_ARGS__); }
16 | #define ALOGI(format, ...) if (JNI_DEBUG) { __android_log_print(ANDROID_LOG_INFO, JNI_TAG, format, ##__VA_ARGS__); }
17 | #define ALOGD(format, ...) if (JNI_DEBUG) { __android_log_print(ANDROID_LOG_DEBUG, JNI_TAG, format, ##__VA_ARGS__); }
18 | #define ALOGW(format, ...) if (JNI_DEBUG) { __android_log_print(ANDROID_LOG_WARN, JNI_TAG, format, ##__VA_ARGS__); }
19 | #else
20 |
21 | #endif
22 |
23 | #endif //AUDIOEFFECTDEMO_NATIVE_LOG_H
24 |
--------------------------------------------------------------------------------
/app/src/main/cpp/base/time_utils.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by templechen on 2019-09-04.
3 | //
4 |
5 | #include
6 | #include "time_utils.h"
7 |
8 | long javaTimeMillis() {
9 | timeval time;
10 | gettimeofday(&time, nullptr);
11 | return long(time.tv_sec) * 1000 + long(time.tv_usec / 1000);
12 | }
--------------------------------------------------------------------------------
/app/src/main/cpp/base/time_utils.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by templechen on 2019-09-04.
3 | //
4 |
5 | #ifndef HYPLAYER_UTILS_H
6 | #define HYPLAYER_UTILS_H
7 |
8 | long javaTimeMillis();
9 |
10 | #endif //HYPLAYER_UTILS_H
11 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fliter/IFilter.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 1/21/22.
3 | //
4 |
5 | #ifndef SKIAUI_IFILTER_H
6 | #define SKIAUI_IFILTER_H
7 |
8 |
9 | #include
10 |
11 | class IFilter {
12 |
13 | public:
14 |
15 | IFilter() {};
16 |
17 | virtual ~IFilter() {};
18 |
19 | virtual void setWindowSize(int width, int height) = 0;
20 |
21 | virtual void doFrame(long time) {
22 | this->time = time;
23 | drawCount++;
24 | if (drawCount > width) {
25 | drawCount = 0;
26 | }
27 | };
28 |
29 | virtual void dispatchTouchEvent(TouchEvent *touchEvent) {}
30 |
31 | protected:
32 |
33 | int width = 0;
34 | int height = 0;
35 |
36 | int drawCount = 0;
37 |
38 | long time;
39 |
40 | };
41 |
42 |
43 | #endif //SKIAUI_IFILTER_H
44 |
--------------------------------------------------------------------------------
/app/src/main/cpp/fliter/SkiaFilter.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 1/21/22.
3 | //
4 |
5 | #ifndef SKIAUI_SKIAFILTER_H
6 | #define SKIAUI_SKIAFILTER_H
7 |
8 |
9 | #include
10 | #include
11 | #include "IFilter.h"
12 | #include "gpu/gl/GrGLInterface.h"
13 | #include "gpu/GrDirectContext.h"
14 | #include "core/SkSurface.h"
15 | #include "core/SkCanvas.h"
16 |
17 | class SkiaFilter : IFilter {
18 |
19 | public:
20 |
21 | SkiaFilter();
22 |
23 | ~SkiaFilter();
24 |
25 | virtual void setWindowSize(int width, int height) override;
26 |
27 | virtual void doFrame(long time) override;
28 |
29 | void dispatchTouchEvent(TouchEvent *touchEvent) override;
30 |
31 | void setVelocity(Velocity *velocity);
32 |
33 | private:
34 |
35 | sk_sp skiaSurface;
36 |
37 | sk_sp skiaContext;
38 |
39 | SkCanvas *skCanvas;
40 |
41 | std::unique_ptr mTouchEvent;
42 |
43 | ITestDraw *testDraw;
44 | };
45 |
46 |
47 | #endif //SKIAUI_SKIAFILTER_H
48 |
--------------------------------------------------------------------------------
/app/src/main/cpp/gl/HYAssetsHolder.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 10/29/21.
3 | //
4 |
5 | #ifndef HYNDKPLAYER_HYASSETSHOLDER_H
6 | #define HYNDKPLAYER_HYASSETSHOLDER_H
7 |
8 | #endif //HYNDKPLAYER_HYASSETSHOLDER_H
9 |
10 | #include "jni.h"
11 |
12 | class HYAssetsHolder {
13 |
14 | public:
15 |
16 | static HYAssetsHolder &get() {
17 | static HYAssetsHolder assetsHolder;
18 | return assetsHolder;
19 | }
20 |
21 | void setJVM(JavaVM *jvm) {
22 | this->javaVm = jvm;
23 | }
24 |
25 | void refJavaAssets(JNIEnv *env, jobject javaAssets) {
26 | this->javaAssets = javaAssets;
27 | javaAssetsRef = env->NewGlobalRef(javaAssets);
28 | }
29 |
30 | void unRefJavaAssets(JNIEnv *env) {
31 | env->DeleteGlobalRef(javaAssetsRef);
32 | }
33 |
34 | jobject getJavaAssets() {
35 | return javaAssetsRef;
36 | }
37 |
38 | JavaVM *javaVm;
39 |
40 | private:
41 |
42 | HYAssetsHolder() {}
43 |
44 | HYAssetsHolder(const HYAssetsHolder &) = delete;
45 |
46 | HYAssetsHolder(const HYAssetsHolder &&) = delete;
47 |
48 | jobject javaAssets;
49 |
50 | jobject javaAssetsRef;
51 |
52 | };
--------------------------------------------------------------------------------
/app/src/main/cpp/gl/HYEGLContext.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2021/3/12.
3 | //
4 |
5 | #ifndef HYEDITOR_TEMPLEEGLCONTEXT_H
6 | #define HYEDITOR_TEMPLEEGLCONTEXT_H
7 |
8 |
9 | #include
10 | #include "HYEGLRender.h"
11 |
12 | class HYEGLContext : public Looper {
13 |
14 | public:
15 | enum TempleMsg {
16 | kMsgTempleInit,
17 | kMsgTempleUnInit,
18 | kMsgSurfaceOnCreate,
19 | kMsgSurfaceSizeChanged,
20 | kMsgSurfaceOnDestroy,
21 | kMsgDoFrame,
22 | kMsgTouchEvent,
23 | kMsgTouchVelocity
24 | };
25 |
26 | public:
27 |
28 | HYEGLContext(JavaVM *javaVm);
29 |
30 | ~HYEGLContext() override;
31 |
32 | void handleMessage(LooperMessage *msg) override;
33 |
34 | void pthreadExit() override;
35 |
36 | private:
37 |
38 | HYEGLRender *render;
39 |
40 | };
41 |
42 |
43 | #endif //HYEDITOR_TEMPLEEGLCONTEXT_H
44 |
--------------------------------------------------------------------------------
/app/src/main/cpp/gl/HYEGLCore.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2021/6/2.
3 | //
4 |
5 | #ifndef HYEDITOR_EGLCORE_H
6 | #define HYEDITOR_EGLCORE_H
7 |
8 | #include "EGL/egl.h"
9 | #include "GLES3/gl3.h"
10 | #include "GLES3/gl3ext.h"
11 | #include "EGL/eglext.h"
12 |
13 | class HYEGLCore {
14 |
15 | public:
16 |
17 | HYEGLCore();
18 |
19 | ~HYEGLCore();
20 |
21 | /**
22 | * sharedCtx, 共享egl上下文
23 | * nativeWindow == nullptr 离屏
24 | * @param nativeWindow
25 | */
26 | int createGLEnv(EGLContext sharedCtx, ANativeWindow *nativeWindow, int width, int height, bool offScreen);
27 |
28 | void releaseGLEnv();
29 |
30 | EGLSurface getEGLSurface();
31 |
32 | EGLContext getEGLContext();
33 |
34 | EGLDisplay getEGLDisplay();
35 |
36 | void swapBuffer();
37 |
38 | void makeCurrent();
39 |
40 | private:
41 |
42 | EGLConfig mEGLConf;
43 | EGLSurface mEGLSurface;
44 | EGLContext mEGLCtx;
45 | EGLDisplay mEGLDisplay;
46 |
47 | };
48 |
49 |
50 | #endif //HYEDITOR_EGLCORE_H
51 |
--------------------------------------------------------------------------------
/app/src/main/cpp/gl/HYEGLRender.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2021/3/12.
3 | //
4 |
5 | #ifndef HYEDITOR_TEMPLEEGLRENDER_H
6 | #define HYEDITOR_TEMPLEEGLRENDER_H
7 |
8 | #include
9 | #include
10 | #include "memory"
11 | #include "HYEGLCore.h"
12 | #include "HYAssetsHolder.h"
13 | #include "SkiaFilter.h"
14 | #include "TouchEvent.h"
15 |
16 | class HYEGLRender {
17 |
18 | public:
19 |
20 | HYEGLRender(JNIEnv *env) {
21 | mEGLCore = std::make_unique();
22 | }
23 |
24 | ~HYEGLRender();
25 |
26 | void OnSurfaceCreated(ANativeWindow *nativeWindow);
27 |
28 | void OnSurfaceChanged(int width, int height);
29 |
30 | void OnSurfaceDestroyed();
31 |
32 | void OnDoFrame(long timeMills);
33 |
34 | void DispatchTouchEvent(TouchEvent *touchEvent);
35 |
36 | void DispatchTouchVelocity(Velocity *velocity);
37 |
38 | private:
39 |
40 | int CreateGLEnv(ANativeWindow *nativeWindow);
41 |
42 | void ReleaseGLEnv();
43 |
44 | std::unique_ptr mEGLCore;
45 |
46 | void initFilter();
47 |
48 | std::unique_ptr mFilter;
49 |
50 | };
51 |
52 |
53 | #endif //HYEDITOR_TEMPLEEGLRENDER_H
54 |
--------------------------------------------------------------------------------
/app/src/main/cpp/plugin/IPlugin.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2023/1/6.
3 | //
4 |
5 | #include "IPlugin.h"
6 |
--------------------------------------------------------------------------------
/app/src/main/cpp/plugin/IPlugin.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2023/1/6.
3 | //
4 |
5 | #ifndef SKIAUI_IPLUGIN_H
6 | #define SKIAUI_IPLUGIN_H
7 |
8 | #include "string"
9 |
10 | class IPlugin {
11 |
12 | public:
13 |
14 | IPlugin() = delete;
15 |
16 | IPlugin(std::string name);
17 |
18 | };
19 |
20 |
21 | #endif //SKIAUI_IPLUGIN_H
22 |
--------------------------------------------------------------------------------
/app/src/main/cpp/plugin/PluginManager.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2023/1/6.
3 | //
4 |
5 | #include "PluginManager.h"
6 |
7 | PluginManager::PluginManager() {
8 |
9 | }
10 |
11 | PluginManager::~PluginManager() {
12 |
13 | }
14 |
15 | void PluginManager::registerPlugin(IPlugin *plugin) {
16 |
17 | }
18 |
19 | void PluginManager::clearPlugins() {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/cpp/plugin/PluginManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2023/1/6.
3 | //
4 |
5 | #ifndef SKIAUI_PLUGINMANAGER_H
6 | #define SKIAUI_PLUGINMANAGER_H
7 |
8 | #include "IPlugin.h"
9 |
10 | class PluginManager {
11 |
12 | private:
13 |
14 | PluginManager();
15 |
16 | public:
17 |
18 | PluginManager(const PluginManager &manager) = delete;
19 |
20 | void operator=(PluginManager &manager) = delete;
21 |
22 | ~PluginManager();
23 |
24 | void registerPlugin(IPlugin *plugin);
25 |
26 | void clearPlugins();
27 |
28 | static PluginManager &getInstance() {
29 | static PluginManager manager;
30 | return manager;
31 | }
32 |
33 | };
34 |
35 |
36 | #endif //SKIAUI_PLUGINMANAGER_H
37 |
--------------------------------------------------------------------------------
/app/src/main/cpp/scroll/Scroller.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/6/26.
3 | //
4 |
5 | #include "Scroller.h"
6 |
--------------------------------------------------------------------------------
/app/src/main/cpp/scroll/Scroller.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/6/26.
3 | //
4 |
5 | #ifndef SKIAUI_SCROLLER_H
6 | #define SKIAUI_SCROLLER_H
7 |
8 | class Scroller {
9 |
10 | };
11 |
12 | #endif //SKIAUI_SCROLLER_H
13 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/HYListAdapter.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/8/18.
3 | //
4 |
5 | #include
6 | #include "HYListAdapter.h"
7 |
8 | HYListAdapter::HYListAdapter() {
9 |
10 | }
11 |
12 | HYListAdapter::~HYListAdapter() {
13 |
14 | }
15 |
16 | View *HYListAdapter::createView(int index) {
17 | auto textView = new TextView();
18 | textView->setText(SkString("123456abc"));
19 | textView->setTextColor(SK_ColorBLACK);
20 | textView->setTextSize(60);
21 | textView->setBackgroundColor(SK_ColorRED);
22 | textView->setStyle(SkPaint::kStroke_Style);
23 | textView->setDecoration(kLineThrough);
24 | textView->setDecorationStyle(kSolid);
25 | textView->setDecorationThicknessMultiplier(3);
26 | textView->setDecorationColor(SK_ColorRED);
27 | return textView;
28 | }
29 |
30 | void HYListAdapter::bindView(View *view, int model) {
31 |
32 | }
33 |
34 | bool HYListAdapter::canCreateView() {
35 | return BaseListAdapter::canCreateView();
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/HYListAdapter.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/8/18.
3 | //
4 |
5 | #ifndef SKIAUI_HYLISTADAPTER_H
6 | #define SKIAUI_HYLISTADAPTER_H
7 |
8 |
9 | #include
10 |
11 | class HYListAdapter : public BaseListAdapter {
12 |
13 | public:
14 |
15 | HYListAdapter();
16 |
17 | virtual ~HYListAdapter();
18 |
19 | virtual View * createView(int index) override;
20 |
21 | void bindView(View *view, int model) override;
22 |
23 | virtual bool canCreateView() override;
24 |
25 | };
26 |
27 |
28 | #endif //SKIAUI_HYLISTADAPTER_H
29 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/HYListView.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/8/18.
3 | //
4 |
5 | #include "HYListView.h"
6 | #include "HYListAdapter.h"
7 |
8 | HYListView::HYListView() : BaseListView() {
9 | //todo !!!
10 | setCustomTouchEventDispatcher(new ListViewDispatcher(this));
11 | }
12 |
13 | HYListView::~HYListView() {
14 |
15 | }
16 |
17 | void HYListView::setAdapter(BaseListAdapter *adapter) {
18 | BaseListView::setAdapter(adapter);
19 | }
20 |
21 | View *HYListView::createView(int index) {
22 | return adapter->createView(index);
23 | }
24 |
25 | void HYListView::attachChild(View *view) {
26 | if (view == nullptr) {
27 | return;
28 | }
29 | BaseListView::attachChild(view);
30 | auto lp = LayoutParams::makeExactlyWidth(width);
31 | lp->setMargin({0, 20, 0, 20});
32 | FlexboxLayout::addView(view, lp);
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/HYListView.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/8/18.
3 | //
4 |
5 | #ifndef SKIAUI_HYLISTVIEW_H
6 | #define SKIAUI_HYLISTVIEW_H
7 |
8 |
9 | #include
10 |
11 | /**
12 | * 最简单的测试ListView
13 | */
14 | class HYListView : public BaseListView {
15 |
16 | public:
17 |
18 | HYListView();
19 |
20 | virtual ~HYListView();
21 |
22 | View *createView(int index) override;
23 |
24 | void setAdapter(BaseListAdapter *adapter) override;
25 |
26 | void attachChild(View *view) override;
27 |
28 | };
29 |
30 |
31 | #endif //SKIAUI_HYLISTVIEW_H
32 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/HYRecyclerView.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/12/7.
3 | //
4 |
5 | #include "HYRecyclerView.h"
6 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/HorizontalDrawTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/5/24.
3 | //
4 |
5 | #ifndef SKIAUI_HORIZONTALDRAWTEST_H
6 | #define SKIAUI_HORIZONTALDRAWTEST_H
7 |
8 |
9 | #include "ITestDraw.h"
10 |
11 | class HorizontalDrawTest : public ITestDraw {
12 |
13 | public:
14 |
15 | HorizontalDrawTest();
16 |
17 | virtual ~HorizontalDrawTest();
18 |
19 | virtual void doDrawTest(int drawCount, SkCanvas *canvas, int width, int height) override;
20 |
21 | };
22 |
23 |
24 | #endif //SKIAUI_HORIZONTALDRAWTEST_H
25 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/ITestDraw.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/5/24.
3 | //
4 |
5 | #ifndef SKIAUI_ITESTDRAW_H
6 | #define SKIAUI_ITESTDRAW_H
7 |
8 | #include "core/SkCanvas.h"
9 | #include "FlexboxLayout.h"
10 | #include "TextView.h"
11 | #include "ImageView.h"
12 | #include "MovingView.h"
13 |
14 | /**
15 | * 各种布局测试用例
16 | */
17 | class ITestDraw {
18 |
19 | public:
20 |
21 | ITestDraw() {};
22 |
23 | virtual ~ITestDraw() {
24 | delete root;
25 | YGConfigFree(config);
26 | };
27 |
28 | virtual void doDrawTest(int drawCount, SkCanvas *canvas, int width, int height) = 0;
29 |
30 | virtual View *getRootView() {
31 | return root;
32 | };
33 |
34 | protected:
35 |
36 | ViewGroup *root = nullptr;
37 |
38 | YGConfigRef config;
39 |
40 | };
41 |
42 |
43 | #endif //SKIAUI_ITESTDRAW_H
44 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/ImageViewTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/7/1.
3 | //
4 |
5 | #ifndef SKIAUI_IMAGEVIEWTEST_H
6 | #define SKIAUI_IMAGEVIEWTEST_H
7 |
8 |
9 | #include "ITestDraw.h"
10 |
11 | class ImageViewTest : public ITestDraw {
12 |
13 | public:
14 |
15 | ImageViewTest();
16 |
17 | ~ImageViewTest();
18 |
19 | void doDrawTest(int drawCount, SkCanvas *canvas, int width, int height) override;
20 |
21 |
22 | };
23 |
24 |
25 | #endif //SKIAUI_IMAGEVIEWTEST_H
26 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/ListViewTest.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/8/4.
3 | //
4 |
5 | #include
6 | #include "ListViewTest.h"
7 | #include "HYRecyclerView.h"
8 |
9 | ListViewTest::ListViewTest() = default;
10 |
11 | ListViewTest::~ListViewTest() = default;
12 |
13 | void ListViewTest::doDrawTest(int drawCount, SkCanvas *canvas, int width, int height) {
14 | if (root == nullptr) {
15 | auto recyclerView = new HYRecyclerView();
16 | config = YGConfigNew();
17 | root = recyclerView;
18 | root->setConfig(config);
19 | root->setLayoutParams(LayoutParams::makeExactlyLayoutParams(width, height));
20 | root->setFlexWrap(YGWrapNoWrap);
21 | root->setFlexDirection(YGFlexDirectionColumn);
22 | root->setJustifyContent(YGJustifyFlexStart);
23 | root->setAlignItems(YGAlignCenter);
24 | root->setAlignContent(YGAlignCenter);
25 | root->setStrokeWidth(10);
26 | root->setStyle(SkPaint::kStroke_Style);
27 | root->setBackgroundColor(SK_ColorBLUE);
28 | }
29 |
30 | auto rootWidthSpec = MeasureSpec::makeMeasureSpec(width, EXACTLY);
31 | auto rootHeightSpec = MeasureSpec::makeMeasureSpec(height, EXACTLY);
32 | root->measure(rootWidthSpec, rootHeightSpec);
33 | root->layout(0, 0, width, height);
34 | root->draw(canvas);
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/ListViewTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/8/4.
3 | //
4 |
5 | #ifndef SKIAUI_LISTVIEWTEST_H
6 | #define SKIAUI_LISTVIEWTEST_H
7 |
8 |
9 | #include "ITestDraw.h"
10 |
11 | class ListViewTest: public ITestDraw {
12 |
13 | public:
14 |
15 | ListViewTest();
16 |
17 | virtual ~ListViewTest();
18 |
19 | virtual void doDrawTest(int drawCount, SkCanvas *canvas, int width, int height) override;
20 |
21 | };
22 |
23 |
24 | #endif //SKIAUI_LISTVIEWTEST_H
25 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/MovingDrawTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/6/22.
3 | //
4 |
5 | #ifndef SKIAUI_MOVINGDRAWTEST_H
6 | #define SKIAUI_MOVINGDRAWTEST_H
7 |
8 | #include "ITestDraw.h"
9 |
10 | /**
11 | * 跟手移动测试
12 | */
13 | class MovingDrawTest : public ITestDraw {
14 |
15 | public:
16 |
17 | MovingDrawTest();
18 |
19 | virtual ~MovingDrawTest();
20 |
21 | virtual void doDrawTest(int drawCount, SkCanvas *canvas, int width, int height) override;
22 |
23 | };
24 |
25 |
26 | #endif //SKIAUI_MOVINGDRAWTEST_H
27 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/PercentViewTest.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/5/30.
3 | //
4 |
5 | #include "PercentViewTest.h"
6 |
7 | PercentViewTest::PercentViewTest() {
8 |
9 | }
10 |
11 | PercentViewTest::~PercentViewTest() {
12 |
13 | }
14 |
15 | void PercentViewTest::doDrawTest(int drawCount, SkCanvas *canvas, int width, int height) {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/PercentViewTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/5/30.
3 | //
4 |
5 | #ifndef SKIAUI_PERCENTVIEWTEST_H
6 | #define SKIAUI_PERCENTVIEWTEST_H
7 |
8 |
9 | #include "ITestDraw.h"
10 |
11 | class PercentViewTest : public ITestDraw{
12 |
13 | public:
14 |
15 | PercentViewTest();
16 |
17 | ~PercentViewTest();
18 |
19 | void doDrawTest(int drawCount, SkCanvas *canvas, int width, int height) override;
20 |
21 | };
22 |
23 |
24 | #endif //SKIAUI_PERCENTVIEWTEST_H
25 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/ProgressBarDrawTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/8/8.
3 | //
4 |
5 | #ifndef SKIAUI_PROGRESSBARDRAWTEST_H
6 | #define SKIAUI_PROGRESSBARDRAWTEST_H
7 |
8 |
9 | #include "ITestDraw.h"
10 |
11 | class ProgressBarDrawTest: public ITestDraw {
12 |
13 | public:
14 |
15 | ProgressBarDrawTest();
16 |
17 | virtual ~ProgressBarDrawTest();
18 |
19 | void doDrawTest(int drawCount, SkCanvas *canvas, int width, int height) override;
20 |
21 | };
22 |
23 |
24 | #endif //SKIAUI_PROGRESSBARDRAWTEST_H
25 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/ScrollViewTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/7/26.
3 | //
4 |
5 | #ifndef SKIAUI_SCROLLVIEWTEST_H
6 | #define SKIAUI_SCROLLVIEWTEST_H
7 |
8 |
9 | #include "ITestDraw.h"
10 |
11 | class ScrollViewTest: public ITestDraw {
12 |
13 | public:
14 |
15 | ScrollViewTest();
16 |
17 | virtual ~ScrollViewTest();
18 |
19 | void doDrawTest(int drawCount, SkCanvas *canvas, int width, int height) override;
20 |
21 | };
22 |
23 |
24 | #endif //SKIAUI_SCROLLVIEWTEST_H
25 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/TextViewTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/7/2.
3 | //
4 |
5 | #ifndef SKIAUI_TEXTVIEWTEST_H
6 | #define SKIAUI_TEXTVIEWTEST_H
7 |
8 |
9 | #include "ITestDraw.h"
10 | #include "../../jniLibs/skia/include/core/SkCanvas.h"
11 |
12 | class TextViewTest: public ITestDraw{
13 |
14 | public:
15 |
16 | TextViewTest();
17 |
18 | ~TextViewTest();
19 |
20 | virtual void doDrawTest(int drawCount, SkCanvas *canvas, int width, int height);
21 |
22 | };
23 |
24 |
25 | #endif //SKIAUI_TEXTVIEWTEST_H
26 |
--------------------------------------------------------------------------------
/app/src/main/cpp/test/VerticalDrawTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/5/24.
3 | //
4 |
5 | #ifndef SKIAUI_VERTICALDRAWTEST_H
6 | #define SKIAUI_VERTICALDRAWTEST_H
7 |
8 |
9 | #include "ITestDraw.h"
10 |
11 | class VerticalDrawTest : public ITestDraw {
12 |
13 | public:
14 |
15 | VerticalDrawTest();
16 |
17 | virtual ~VerticalDrawTest();
18 |
19 | virtual void doDrawTest(int drawCount, SkCanvas *canvas, int width, int height) override;
20 |
21 | };
22 |
23 |
24 | #endif //SKIAUI_VERTICALDRAWTEST_H
25 |
--------------------------------------------------------------------------------
/app/src/main/cpp/touch/ScrollDispatcher.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/7/26.
3 | //
4 |
5 | #ifndef SKIAUI_SCROLLDISPATCHER_H
6 | #define SKIAUI_SCROLLDISPATCHER_H
7 |
8 | #include
9 | #include "TouchEventDispatcher.h"
10 |
11 | class ScrollDispatcher : public TouchEventDispatcher {
12 |
13 | public:
14 |
15 | friend class ScrollView;
16 |
17 | ScrollDispatcher(ScrollView *view);
18 |
19 | virtual ~ScrollDispatcher();
20 |
21 | virtual bool onTouchEvent(TouchEvent *touchEvent) override;
22 |
23 | virtual void findTargetView(TouchEvent *touchEvent) override;
24 |
25 | virtual void dispatchToTargetView(TouchEvent *touchEvent) override;
26 |
27 | virtual View *
28 | findTargetViewTraversal(ViewGroup *viewGroup, TouchEvent *touchEvent, float tempLeft,
29 | float tempTop) override;
30 |
31 | protected:
32 |
33 | virtual bool canScroll();
34 |
35 | /**
36 | * 当手离开屏幕,scrollView还能滑动时,需要使用动画模拟fling的效果
37 | */
38 | virtual void fling();
39 |
40 | float startX = 0.0f;
41 | float startY = 0.0f;
42 |
43 | ScrollView *scrollView;
44 |
45 | };
46 |
47 |
48 | #endif //SKIAUI_SCROLLDISPATCHER_H
49 |
--------------------------------------------------------------------------------
/app/src/main/cpp/touch/TouchEvent.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/6/4.
3 | //
4 |
5 | #ifndef SKIAUI_TOUCHEVENT_H
6 | #define SKIAUI_TOUCHEVENT_H
7 |
8 | #include "native_log.h"
9 |
10 | class TouchEvent {
11 |
12 | public:
13 |
14 | enum MotionEvent {
15 | ACTION_DOWN = 0,
16 | ACTION_UP = 1,
17 | ACTION_MOVE = 2,
18 | ACTION_CANCEL = 3
19 | };
20 |
21 | TouchEvent(MotionEvent action, float x, float y): action(action), x(x), y(y) {
22 |
23 | }
24 |
25 | ~TouchEvent() {
26 | ALOGD("TouchEvent %s", "~TouchEvent")
27 | }
28 |
29 | public:
30 | MotionEvent action;
31 | float x, y;
32 |
33 | };
34 |
35 | #endif //SKIAUI_TOUCHEVENT_H
36 |
--------------------------------------------------------------------------------
/app/src/main/cpp/touch/TouchEventDispatcher.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/6/4.
3 | //
4 |
5 | #ifndef SKIAUI_TOUCHEVENTDISPATCHER_H
6 | #define SKIAUI_TOUCHEVENTDISPATCHER_H
7 |
8 | #include "TouchEvent.h"
9 | #include "memory"
10 |
11 | class View;
12 |
13 | class ViewGroup;
14 |
15 | class TouchEventDispatcher {
16 |
17 | public:
18 |
19 | TouchEventDispatcher(View *view);
20 |
21 | ~TouchEventDispatcher();
22 |
23 | virtual bool dispatchTouchEvent(TouchEvent *touchEvent);
24 |
25 | virtual bool onInterceptTouchEvent(TouchEvent *touchEvent);
26 |
27 | virtual bool onTouchEvent(TouchEvent *touchEvent);
28 |
29 | virtual void requestDisallowInterceptTouchEvent(bool disallowIntercept);
30 |
31 | virtual void setWeakView(View *view);
32 |
33 | virtual void findTargetView(TouchEvent *touchEvent);
34 |
35 | virtual void dispatchToTargetView(TouchEvent *touchEvent);
36 |
37 | virtual void clearTargetView();
38 |
39 | virtual View *
40 | findTargetViewTraversal(ViewGroup *viewGroup, TouchEvent *touchEvent, float tempLeft,
41 | float tempTop);
42 |
43 | bool checkTouchInTargetView(TouchEvent *touchEvent);
44 |
45 | protected:
46 |
47 | View *view;
48 |
49 | //todo 改用weak_ptr
50 | View *weakTargetView;
51 |
52 | float targetViewLeft = 0.0f;
53 | float targetViewTop = 0.0f;
54 |
55 | };
56 |
57 |
58 | #endif //SKIAUI_TOUCHEVENTDISPATCHER_H
59 |
--------------------------------------------------------------------------------
/app/src/main/cpp/touch/Velocity.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/7/28.
3 | //
4 |
5 | #ifndef SKIAUI_VELOCITY_H
6 | #define SKIAUI_VELOCITY_H
7 |
8 |
9 | class Velocity {
10 |
11 | public:
12 |
13 | Velocity(float x, float y) : xVelocity(x), yVelocity(y) {}
14 |
15 | float xVelocity;
16 |
17 | float yVelocity;
18 |
19 | };
20 |
21 |
22 | #endif //SKIAUI_VELOCITY_H
23 |
--------------------------------------------------------------------------------
/app/src/main/cpp/widget/Button.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/10/26.
3 | //
4 |
5 | #include "Button.h"
6 |
7 | Button::Button() : TextView() {
8 | ripplePaint = new SkPaint();
9 | ripplePaint->setAntiAlias(true);
10 | }
11 |
12 | Button::~Button() {
13 | delete ripplePaint;
14 | }
15 |
16 | void Button::setMeasuredDimension(int _measuredWidth, int _measuredHeight) {
17 | TextView::setMeasuredDimension(_measuredWidth + defaultPadding * 2,
18 | _measuredHeight + defaultPadding * 2);
19 | }
20 |
21 | void Button::draw(SkCanvas *canvas) {
22 | if (cornerRadius == 0) {
23 | setCornerRadius(defaultRadius);
24 | }
25 | View::draw(canvas);
26 | SkASSERT(paragraph);
27 | paragraph->paint(canvas, skRect.left() + defaultPadding, skRect.top() + defaultPadding);
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/cpp/widget/Button.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/10/26.
3 | //
4 |
5 | #ifndef SKIAUI_BUTTON_H
6 | #define SKIAUI_BUTTON_H
7 |
8 |
9 | #include "TextView.h"
10 |
11 | class Button : public TextView {
12 |
13 | public:
14 |
15 | Button();
16 |
17 | ~Button();
18 |
19 | void setMeasuredDimension(int _measuredWidth, int _measuredHeight) override;
20 |
21 | void draw(SkCanvas *canvas) override;
22 |
23 | private:
24 |
25 | /**
26 | * 水波纹
27 | */
28 | SkPaint *ripplePaint;
29 |
30 | int defaultRadius = 20;
31 |
32 | int defaultPadding = 20;
33 |
34 | };
35 |
36 |
37 | #endif //SKIAUI_BUTTON_H
38 |
--------------------------------------------------------------------------------
/app/src/main/cpp/widget/FlexboxLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 2022/5/24.
3 | //
4 |
5 | #ifndef SKIAUI_FLEXBOXLAYOUT_H
6 | #define SKIAUI_FLEXBOXLAYOUT_H
7 |
8 |
9 | #include "ViewGroup.h"
10 |
11 | /**
12 | * 本来模仿Android,实现FrameLayout,LinearLayout,ConstraintLayout实现过于复杂,最终还是简单用一个FlexboxLayout来实现,毕竟Yoga就是基于Flexbox的布局引擎。
13 | */
14 | class FlexboxLayout : public ViewGroup {
15 |
16 | public:
17 |
18 | FlexboxLayout();
19 |
20 | ~FlexboxLayout();
21 |
22 | const char * name() override;
23 |
24 | virtual void setFlexDirection(YGFlexDirection direction) override;
25 |
26 | void measure(int widthMeasureSpec, int heightMeasureSpec) override;
27 |
28 | virtual void layout(int l, int t, int r, int b) override;
29 |
30 | virtual void setFlexWrap(YGWrap wrap) override;
31 |
32 | virtual bool addView(View *view, LayoutParams *layoutParams) override;
33 |
34 | virtual bool removeView(View *view) override;
35 |
36 | YGFlexDirection _direction = YGFlexDirectionColumn;
37 |
38 | protected:
39 |
40 | void layoutVertical(int l, int t, int r, int b);
41 |
42 | void layoutHorizontal(int l, int t, int r, int b);
43 |
44 | };
45 |
46 |
47 | #endif //SKIAUI_FLEXBOXLAYOUT_H
48 |
--------------------------------------------------------------------------------
/app/src/main/cpp/widget/ImageView.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by cw on 1/26/22.
3 | //
4 |
5 | #ifndef SKIAUI_IMAGEVIEW_H
6 | #define SKIAUI_IMAGEVIEW_H
7 |
8 |
9 | #include "View.h"
10 | #include "core/SkImage.h"
11 |
12 | class ImageView : public View {
13 |
14 | public:
15 |
16 | enum class ScaleType {
17 | FitXY,
18 | FitCenter,
19 | CenterCrop
20 | };
21 |
22 | public:
23 |
24 | ImageView();
25 |
26 | virtual ~ImageView();
27 |
28 | void measure(int widthMeasureSpec, int heightMeasureSpec) override;
29 |
30 | void layout(int l, int t, int r, int b) override;
31 |
32 | virtual void draw(SkCanvas *canvas) override;
33 |
34 | virtual const char *name() override;
35 |
36 | virtual void setAlpha(float alpha) override;
37 |
38 | virtual void setCornerRadius(int radius) override;
39 |
40 | #pragma mark ImageView api
41 |
42 | virtual void setSource(const char *path);
43 |
44 | virtual void setScaleType(ScaleType scaleType);
45 |
46 | private:
47 |
48 | sk_sp skImage;
49 |
50 | SkRect srcRect;
51 |
52 | SkRect dstRect;
53 |
54 | SkRRect clipRect;
55 |
56 | std::unique_ptr imagePaint;
57 |
58 | SkMatrix imageMatrix;
59 |
60 | float radius;
61 |
62 | ScaleType scaleType;
63 |
64 | };
65 |
66 |
67 | #endif //SKIAUI_IMAGEVIEW_H
68 |
--------------------------------------------------------------------------------
/app/src/main/cpp/widget/MovingView.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/6/22.
3 | //
4 |
5 | #ifndef SKIAUI_MOVINGVIEW_H
6 | #define SKIAUI_MOVINGVIEW_H
7 |
8 |
9 | #include "View.h"
10 |
11 | class MovingView : public View {
12 |
13 | public:
14 |
15 | MovingView();
16 |
17 | virtual ~MovingView();
18 |
19 | virtual void layout(int l, int t, int r, int b) override;
20 |
21 | virtual bool onTouchEvent(TouchEvent *touchEvent) override;
22 |
23 | const char *name() override;
24 |
25 | virtual bool forceRequestTouchMove() override;
26 |
27 | private:
28 |
29 | float lastX;
30 | float lastY;
31 |
32 | };
33 |
34 |
35 | #endif //SKIAUI_MOVINGVIEW_H
36 |
--------------------------------------------------------------------------------
/app/src/main/cpp/widget/RecyclerViewHolder.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteDance on 2022/12/6.
3 | //
4 |
5 | #ifndef SKIAUI_RECYCLERVIEWHOLDER_H
6 | #define SKIAUI_RECYCLERVIEWHOLDER_H
7 |
8 | #include "View.h"
9 |
10 | template
11 | class RecyclerViewHolder {
12 |
13 | public:
14 |
15 | RecyclerViewHolder(View *itemView) {
16 | assert(itemView != nullptr);
17 | this->itemView = itemView;
18 | }
19 |
20 | virtual ~RecyclerViewHolder() {
21 | delete itemView;
22 | }
23 |
24 | /**
25 | * 更新View
26 | * @param item
27 | */
28 | virtual void updateView(T item) = 0;
29 |
30 | virtual View *getItemView() {
31 | return itemView;
32 | }
33 |
34 | protected:
35 |
36 | View *itemView;
37 |
38 | };
39 |
40 | #endif //SKIAUI_RECYCLERVIEWHOLDER_H
41 |
--------------------------------------------------------------------------------
/app/src/main/cpp/yoga/YGConfig.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #include "YGConfig.h"
9 |
10 | YGConfig::YGConfig(YGLogger logger) : cloneNodeCallback_{nullptr} {
11 | logger_.noContext = logger;
12 | loggerUsesContext_ = false;
13 | }
14 |
15 | void YGConfig::log(
16 | YGConfig* config,
17 | YGNode* node,
18 | YGLogLevel logLevel,
19 | void* logContext,
20 | const char* format,
21 | va_list args) {
22 | if (loggerUsesContext_) {
23 | logger_.withContext(config, node, logLevel, logContext, format, args);
24 | } else {
25 | logger_.noContext(config, node, logLevel, format, args);
26 | }
27 | }
28 |
29 | YGNodeRef YGConfig::cloneNode(
30 | YGNodeRef node,
31 | YGNodeRef owner,
32 | int childIndex,
33 | void* cloneContext) {
34 | YGNodeRef clone = nullptr;
35 | if (cloneNodeCallback_.noContext != nullptr) {
36 | clone = cloneNodeUsesContext_
37 | ? cloneNodeCallback_.withContext(node, owner, childIndex, cloneContext)
38 | : cloneNodeCallback_.noContext(node, owner, childIndex);
39 | }
40 | if (clone == nullptr) {
41 | clone = YGNodeClone(node);
42 | }
43 | return clone;
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/cpp/yoga/YGMacros.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #pragma once
9 |
10 | #ifdef __cplusplus
11 | #define YG_EXTERN_C_BEGIN extern "C" {
12 | #define YG_EXTERN_C_END }
13 | #else
14 | #define YG_EXTERN_C_BEGIN
15 | #define YG_EXTERN_C_END
16 | #endif
17 |
18 | #ifdef _WINDLL
19 | #define WIN_EXPORT __declspec(dllexport)
20 | #else
21 | #define WIN_EXPORT
22 | #endif
23 |
24 | #ifndef YOGA_EXPORT
25 | #ifdef _MSC_VER
26 | #define YOGA_EXPORT
27 | #else
28 | #define YOGA_EXPORT __attribute__((visibility("default")))
29 | #endif
30 | #endif
31 |
32 | #ifdef NS_ENUM
33 | // Cannot use NSInteger as NSInteger has a different size than int (which is the
34 | // default type of a enum). Therefor when linking the Yoga C library into obj-c
35 | // the header is a missmatch for the Yoga ABI.
36 | #define YG_ENUM_BEGIN(name) NS_ENUM(int, name)
37 | #define YG_ENUM_END(name)
38 | #else
39 | #define YG_ENUM_BEGIN(name) enum name
40 | #define YG_ENUM_END(name) name
41 | #endif
42 |
43 | #ifdef __GNUC__
44 | #define YG_DEPRECATED __attribute__((deprecated))
45 | #elif defined(_MSC_VER)
46 | #define YG_DEPRECATED __declspec(deprecated)
47 | #elif __cplusplus >= 201402L
48 | #if defined(__has_cpp_attribute)
49 | #if __has_cpp_attribute(deprecated)
50 | #define YG_DEPRECATED [[deprecated]]
51 | #endif
52 | #endif
53 | #endif
54 |
--------------------------------------------------------------------------------
/app/src/main/cpp/yoga/YGNodePrint.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #ifdef DEBUG
9 | #pragma once
10 | #include
11 |
12 | #include "Yoga.h"
13 |
14 | namespace facebook {
15 | namespace yoga {
16 |
17 | void YGNodeToString(
18 | std::string& str,
19 | YGNodeRef node,
20 | YGPrintOptions options,
21 | uint32_t level);
22 |
23 | } // namespace yoga
24 | } // namespace facebook
25 | #endif
26 |
--------------------------------------------------------------------------------
/app/src/main/cpp/yoga/YGValue.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #include "YGValue.h"
9 |
10 | const YGValue YGValueZero = {0, YGUnitPoint};
11 | const YGValue YGValueUndefined = {YGUndefined, YGUnitUndefined};
12 | const YGValue YGValueAuto = {YGUndefined, YGUnitAuto};
13 |
--------------------------------------------------------------------------------
/app/src/main/cpp/yoga/internal/experiments-inl.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #pragma once
9 |
10 | #include "experiments.h"
11 |
12 | #include
13 |
14 | namespace facebook {
15 | namespace yoga {
16 | namespace internal {
17 |
18 | namespace detail {
19 | extern std::bitset enabledExperiments;
20 | } // namespace detail
21 |
22 | inline bool isEnabled(Experiment experiment) {
23 | return detail::enabledExperiments.test(static_cast(experiment));
24 | }
25 |
26 | inline void disableAllExperiments() {
27 | detail::enabledExperiments = 0;
28 | }
29 |
30 | } // namespace internal
31 | } // namespace yoga
32 | } // namespace facebook
33 |
--------------------------------------------------------------------------------
/app/src/main/cpp/yoga/internal/experiments.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #include "experiments.h"
9 | #include "experiments-inl.h"
10 |
11 | namespace facebook {
12 | namespace yoga {
13 | namespace internal {
14 |
15 | namespace detail {
16 |
17 | std::bitset enabledExperiments = 0;
18 |
19 | } // namespace detail
20 |
21 | void enable(Experiment experiment) {
22 | detail::enabledExperiments.set(static_cast(experiment));
23 | }
24 |
25 | void disable(Experiment experiment) {
26 | detail::enabledExperiments.reset(static_cast(experiment));
27 | }
28 |
29 | bool toggle(Experiment experiment) {
30 | auto bit = static_cast(experiment);
31 | auto previousState = detail::enabledExperiments.test(bit);
32 | detail::enabledExperiments.flip(bit);
33 | return previousState;
34 | }
35 |
36 | } // namespace internal
37 | } // namespace yoga
38 | } // namespace facebook
39 |
--------------------------------------------------------------------------------
/app/src/main/cpp/yoga/internal/experiments.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #pragma once
9 |
10 | #include
11 |
12 | namespace facebook {
13 | namespace yoga {
14 | namespace internal {
15 |
16 | enum struct Experiment : size_t {
17 | kDoubleMeasureCallbacks,
18 | };
19 |
20 | void enable(Experiment);
21 | void disable(Experiment);
22 | bool toggle(Experiment);
23 |
24 | } // namespace internal
25 | } // namespace yoga
26 | } // namespace facebook
27 |
--------------------------------------------------------------------------------
/app/src/main/cpp/yoga/log.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #pragma once
9 |
10 | #include "YGEnums.h"
11 |
12 | struct YGNode;
13 | struct YGConfig;
14 |
15 | namespace facebook {
16 | namespace yoga {
17 |
18 | namespace detail {
19 |
20 | struct Log {
21 | static void log(
22 | YGNode* node,
23 | YGLogLevel level,
24 | void*,
25 | const char* message,
26 | ...) noexcept;
27 |
28 | static void log(
29 | YGConfig* config,
30 | YGLogLevel level,
31 | void*,
32 | const char* format,
33 | ...) noexcept;
34 | };
35 |
36 | } // namespace detail
37 | } // namespace yoga
38 | } // namespace facebook
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/temple/skiaui/HYSkiaSurfaceView.kt:
--------------------------------------------------------------------------------
1 | package com.temple.skiaui
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.view.*
6 |
7 | class HYSkiaSurfaceView @JvmOverloads constructor(
8 | context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
9 | ) : SurfaceView(context, attrs, defStyleAttr), SurfaceHolder.Callback {
10 |
11 | private val engine = HYSkiaEngine()
12 |
13 | init {
14 | holder.addCallback(this)
15 | }
16 |
17 | override fun surfaceCreated(holder: SurfaceHolder) {
18 | engine.createSurface(holder.surface)
19 | }
20 |
21 | override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
22 | engine.changeSurfaceSize(width, height)
23 | }
24 |
25 | override fun surfaceDestroyed(holder: SurfaceHolder) {
26 | engine.destroySurface()
27 | }
28 |
29 | override fun dispatchTouchEvent(event: MotionEvent): Boolean {
30 | return engine.dispatchHYTouchEvent(event)
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/temple/skiaui/HYSkiaTextureView.kt:
--------------------------------------------------------------------------------
1 | package com.temple.skiaui
2 |
3 | import android.content.Context
4 | import android.graphics.SurfaceTexture
5 | import android.util.AttributeSet
6 | import android.view.*
7 |
8 | /**
9 | * 使用SurfaceView,渲染延迟感觉比TextureView要明显,同样都是监听vync信号,在doFrame回调里进行渲染,
10 | * 比如跟手这个直观的感觉,TextureView要比SurfaceView好。
11 | */
12 | class HYSkiaTextureView @JvmOverloads constructor(
13 | context: Context, attrs: AttributeSet? = null
14 | ) : TextureView(context, attrs), TextureView.SurfaceTextureListener {
15 |
16 | private val engine = HYSkiaEngine()
17 |
18 | init {
19 | surfaceTextureListener = this
20 | }
21 |
22 | override fun onSurfaceTextureAvailable(surface: SurfaceTexture, width: Int, height: Int) {
23 | engine.createSurface(Surface(surface))
24 | engine.changeSurfaceSize(width, height)
25 | }
26 |
27 | override fun onSurfaceTextureDestroyed(surface: SurfaceTexture): Boolean {
28 | engine.destroySurface()
29 | return true
30 | }
31 |
32 | override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture, width: Int, height: Int) {
33 |
34 | }
35 |
36 | override fun onSurfaceTextureUpdated(surface: SurfaceTexture) {
37 |
38 | }
39 |
40 | override fun dispatchTouchEvent(event: MotionEvent): Boolean {
41 | return engine.dispatchHYTouchEvent(event)
42 | }
43 |
44 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/temple/skiaui/RenderMode.kt:
--------------------------------------------------------------------------------
1 | package com.temple.skiaui
2 |
3 | /**
4 | * 参考Flutter的配置
5 | */
6 | enum class RenderMode {
7 |
8 | /**
9 | * {@code RenderMode}, which paints a Flutter UI to a {@link android.view.SurfaceView}. This mode
10 | * has the best performance, but a Flutter UI in this mode cannot be positioned between 2 other
11 | * Android {@code View}s in the z-index, nor can it be animated/transformed. Unless the special
12 | * capabilities of a {@link android.graphics.SurfaceTexture} are required, developers should
13 | * strongly prefer this render mode.
14 | */
15 | Surface,
16 |
17 | /**
18 | * {@code RenderMode}, which paints a Flutter UI to a {@link android.graphics.SurfaceTexture}.
19 | * This mode is not as performant as {@link #surface}, but a Flutter UI in this mode can be
20 | * animated and transformed, as well as positioned in the z-index between 2+ other Android {@code
21 | * Views}. Unless the special capabilities of a {@link android.graphics.SurfaceTexture} are
22 | * required, developers should strongly prefer the {@link #surface} render mode.
23 | */
24 | Texture
25 |
26 | }
--------------------------------------------------------------------------------
/app/src/main/jniLibs/arm64-v8a/libfreetype2.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/src/main/jniLibs/arm64-v8a/libfreetype2.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/arm64-v8a/libharfbuzz.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/src/main/jniLibs/arm64-v8a/libharfbuzz.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/arm64-v8a/libicu.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/src/main/jniLibs/arm64-v8a/libicu.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/arm64-v8a/libskcms.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/src/main/jniLibs/arm64-v8a/libskcms.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/arm64-v8a/libskia.a:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:87fc2d0fa8dcf22e6412e767f3a99922716e68d41ecd0f3b1aa61b288549bca5
3 | size 197261696
4 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/arm64-v8a/libskparagraph.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/src/main/jniLibs/arm64-v8a/libskparagraph.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/arm64-v8a/libskresources.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/src/main/jniLibs/arm64-v8a/libskresources.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/arm64-v8a/libskshaper.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/src/main/jniLibs/arm64-v8a/libskshaper.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/arm64-v8a/libskunicode.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/src/main/jniLibs/arm64-v8a/libskunicode.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/arm64-v8a/libsvg.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tanpuer/SkiaUI/b9660bc443a6c581d2c9bd5266cbcee53647b29c/app/src/main/jniLibs/arm64-v8a/libsvg.a
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/android/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "SkAndroidFrameworkUtils.h",
11 | "SkAnimatedImage.h",
12 | ],
13 | visibility = ["//include:__pkg__"],
14 | )
15 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/c/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/c/sk_colorspace.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9 | // DO NOT USE -- FOR INTERNAL TESTING ONLY
10 |
11 | #ifndef sk_colorspace_DEFINED
12 | #define sk_colorspace_DEFINED
13 |
14 | #include "include/c/sk_types.h"
15 |
16 | SK_C_PLUS_PLUS_BEGIN_GUARD
17 |
18 | SK_API sk_colorspace_t* sk_colorspace_new_srgb();
19 |
20 | SK_API void sk_colorspace_ref(sk_colorspace_t*);
21 | SK_API void sk_colorspace_unref(sk_colorspace_t*);
22 |
23 | SK_C_PLUS_PLUS_END_GUARD
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/codec/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "SkAndroidCodec.h",
11 | "SkCodec.h",
12 | "SkCodecAnimation.h",
13 | "SkEncodedOrigin.h",
14 | ],
15 | visibility = ["//include:__pkg__"],
16 | )
17 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/config/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "SkUserConfig.h",
11 | ],
12 | visibility = ["//include:__pkg__"],
13 | )
14 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkBlender.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkBlender_DEFINED
9 | #define SkBlender_DEFINED
10 |
11 | #include "include/core/SkBlendMode.h"
12 | #include "include/core/SkFlattenable.h"
13 |
14 | /**
15 | * SkBlender represents a custom blend function in the Skia pipeline. When an SkBlender is
16 | * present in a paint, the SkBlendMode is ignored. A blender combines a source color (the
17 | * result of our paint) and destination color (from the canvas) into a final color.
18 | */
19 | class SK_API SkBlender : public SkFlattenable {
20 | public:
21 | /**
22 | * Create a blender that implements the specified BlendMode.
23 | */
24 | static sk_sp Mode(SkBlendMode mode);
25 |
26 | private:
27 | SkBlender() = default;
28 | friend class SkBlenderBase;
29 |
30 | using INHERITED = SkFlattenable;
31 | };
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkBlurTypes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkBlurTypes_DEFINED
9 | #define SkBlurTypes_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | enum SkBlurStyle : int {
14 | kNormal_SkBlurStyle, //!< fuzzy inside and outside
15 | kSolid_SkBlurStyle, //!< solid inside, fuzzy outside
16 | kOuter_SkBlurStyle, //!< nothing inside, fuzzy outside
17 | kInner_SkBlurStyle, //!< fuzzy inside, nothing outside
18 |
19 | kLastEnum_SkBlurStyle = kInner_SkBlurStyle,
20 | };
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkCapabilities.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkCapabilities_DEFINED
9 | #define SkCapabilities_DEFINED
10 |
11 | #include "include/core/SkRefCnt.h"
12 |
13 | #ifdef SK_ENABLE_SKSL
14 | #include "include/sksl/SkSLVersion.h"
15 | namespace SkSL { struct ShaderCaps; }
16 | #endif
17 |
18 | class SK_API SkCapabilities : public SkRefCnt {
19 | public:
20 | static sk_sp RasterBackend();
21 |
22 | #ifdef SK_ENABLE_SKSL
23 | SkSL::Version skslVersion() const { return fSkSLVersion; }
24 | #endif
25 |
26 | protected:
27 | SkCapabilities() = default;
28 |
29 | #ifdef SK_ENABLE_SKSL
30 | void initSkCaps(const SkSL::ShaderCaps*);
31 |
32 | SkSL::Version fSkSLVersion = SkSL::Version::k100;
33 | #endif
34 | };
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkClipOp.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkClipOp_DEFINED
9 | #define SkClipOp_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | enum class SkClipOp {
14 | kDifference = 0,
15 | kIntersect = 1,
16 | kMax_EnumValue = kIntersect
17 | };
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkCoverageMode.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkCoverageMode_DEFINED
9 | #define SkCoverageMode_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | /**
14 | * Describes geometric operations (ala SkRegion::Op) that can be applied to coverage bytes.
15 | * These can be thought of as variants of porter-duff (SkBlendMode) modes, but only applied
16 | * to the alpha channel.
17 | *
18 | * See SkMaskFilter for ways to use these when combining two different masks.
19 | */
20 | enum class SkCoverageMode {
21 | kUnion, // A ∪ B A+B-A*B
22 | kIntersect, // A ∩ B A*B
23 | kDifference, // A - B A*(1-B)
24 | kReverseDifference, // B - A B*(1-A)
25 | kXor, // A ⊕ B A+B-2*A*B
26 |
27 | kLast = kXor,
28 | };
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkCubicMap.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkCubicMap_DEFINED
9 | #define SkCubicMap_DEFINED
10 |
11 | #include "include/core/SkPoint.h"
12 |
13 | /**
14 | * Fast evaluation of a cubic ease-in / ease-out curve. This is defined as a parametric cubic
15 | * curve inside the unit square.
16 | *
17 | * pt[0] is implicitly { 0, 0 }
18 | * pt[3] is implicitly { 1, 1 }
19 | * pts[1,2].X are inside the unit [0..1]
20 | */
21 | class SK_API SkCubicMap {
22 | public:
23 | SkCubicMap(SkPoint p1, SkPoint p2);
24 |
25 | static bool IsLinear(SkPoint p1, SkPoint p2) {
26 | return SkScalarNearlyEqual(p1.fX, p1.fY) && SkScalarNearlyEqual(p2.fX, p2.fY);
27 | }
28 |
29 | float computeYFromX(float x) const;
30 |
31 | SkPoint computeFromT(float t) const;
32 |
33 | private:
34 | enum Type {
35 | kLine_Type, // x == y
36 | kCubeRoot_Type, // At^3 == x
37 | kSolver_Type, // general monotonic cubic solver
38 | };
39 |
40 | SkPoint fCoeff[3];
41 | Type fType;
42 | };
43 |
44 | #endif
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkEncodedImageFormat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkEncodedImageFormat_DEFINED
9 | #define SkEncodedImageFormat_DEFINED
10 |
11 | #include
12 |
13 | /**
14 | * Enum describing format of encoded data.
15 | */
16 | enum class SkEncodedImageFormat {
17 | #ifdef SK_BUILD_FOR_GOOGLE3
18 | kUnknown,
19 | #endif
20 | kBMP,
21 | kGIF,
22 | kICO,
23 | kJPEG,
24 | kPNG,
25 | kWBMP,
26 | kWEBP,
27 | kPKM,
28 | kKTX,
29 | kASTC,
30 | kDNG,
31 | kHEIF,
32 | kAVIF,
33 | kJPEGXL,
34 | };
35 |
36 | #endif // SkEncodedImageFormat_DEFINED
37 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkFontTypes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkFontTypes_DEFINED
9 | #define SkFontTypes_DEFINED
10 |
11 | enum class SkTextEncoding {
12 | kUTF8, //!< uses bytes to represent UTF-8 or ASCII
13 | kUTF16, //!< uses two byte words to represent most of Unicode
14 | kUTF32, //!< uses four byte words to represent all of Unicode
15 | kGlyphID, //!< uses two byte words to represent glyph indices
16 | };
17 |
18 | enum class SkFontHinting {
19 | kNone, //!< glyph outlines unchanged
20 | kSlight, //!< minimal modification to improve constrast
21 | kNormal, //!< glyph outlines modified to improve constrast
22 | kFull, //!< modifies glyph outlines for maximum constrast
23 | };
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkICC.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkICC_DEFINED
9 | #define SkICC_DEFINED
10 |
11 | #include "include/core/SkData.h"
12 |
13 | struct skcms_Matrix3x3;
14 | struct skcms_TransferFunction;
15 |
16 | SK_API sk_sp SkWriteICCProfile(const skcms_TransferFunction&,
17 | const skcms_Matrix3x3& toXYZD50);
18 |
19 | #endif//SkICC_DEFINED
20 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkMilestone.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 | #ifndef SK_MILESTONE
8 | #define SK_MILESTONE 105
9 | #endif
10 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkOpenTypeSVGDecoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkOpenTypeSVGDecoder_DEFINED
9 | #define SkOpenTypeSVGDecoder_DEFINED
10 |
11 | #include "include/core/SkColor.h"
12 | #include "include/core/SkSpan.h"
13 | #include "include/core/SkTypes.h"
14 |
15 | #include
16 |
17 | class SkCanvas;
18 |
19 | class SkOpenTypeSVGDecoder {
20 | public:
21 | /** Each instance probably owns an SVG DOM.
22 | * The instance may be cached so needs to report how much memory it retains.
23 | */
24 | virtual size_t approximateSize() = 0;
25 | virtual bool render(SkCanvas&, int upem, SkGlyphID glyphId,
26 | SkColor foregroundColor, SkSpan palette) = 0;
27 | virtual ~SkOpenTypeSVGDecoder() = default;
28 | };
29 |
30 | #endif // SkOpenTypeSVGDecoder_DEFINED
31 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkSwizzle.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSwizzle_DEFINED
9 | #define SkSwizzle_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | /**
14 | Swizzles byte order of |count| 32-bit pixels, swapping R and B.
15 | (RGBA <-> BGRA)
16 | */
17 | SK_API void SkSwapRB(uint32_t* dest, const uint32_t* src, int count);
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkTileMode.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkTileModes_DEFINED
9 | #define SkTileModes_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | enum class SkTileMode {
14 | /**
15 | * Replicate the edge color if the shader draws outside of its
16 | * original bounds.
17 | */
18 | kClamp,
19 |
20 | /**
21 | * Repeat the shader's image horizontally and vertically.
22 | */
23 | kRepeat,
24 |
25 | /**
26 | * Repeat the shader's image horizontally and vertically, alternating
27 | * mirror images so that adjacent images always seam.
28 | */
29 | kMirror,
30 |
31 | /**
32 | * Only draw within the original domain, return transparent-black everywhere else.
33 | */
34 | kDecal,
35 |
36 | kLastTileMode = kDecal,
37 | };
38 |
39 | static constexpr int kSkTileModeCount = static_cast(SkTileMode::kLastTileMode) + 1;
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/core/SkUnPreMultiply.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Copyright 2008 The Android Open Source Project
4 | *
5 | * Use of this source code is governed by a BSD-style license that can be
6 | * found in the LICENSE file.
7 | */
8 |
9 |
10 |
11 |
12 |
13 | #ifndef SkUnPreMultiply_DEFINED
14 | #define SkUnPreMultiply_DEFINED
15 |
16 | #include "include/core/SkColor.h"
17 |
18 | class SK_API SkUnPreMultiply {
19 | public:
20 | typedef uint32_t Scale;
21 |
22 | // index this table with alpha [0..255]
23 | static const Scale* GetScaleTable() {
24 | return gTable;
25 | }
26 |
27 | static Scale GetScale(U8CPU alpha) {
28 | SkASSERT(alpha <= 255);
29 | return gTable[alpha];
30 | }
31 |
32 | /** Usage:
33 |
34 | const Scale* table = SkUnPreMultiply::GetScaleTable();
35 |
36 | for (...) {
37 | unsigned a = ...
38 | SkUnPreMultiply::Scale scale = table[a];
39 |
40 | red = SkUnPreMultiply::ApplyScale(scale, red);
41 | ...
42 | // now red is unpremultiplied
43 | }
44 | */
45 | static U8CPU ApplyScale(Scale scale, U8CPU component) {
46 | SkASSERT(component <= 255);
47 | return (scale * component + (1 << 23)) >> 24;
48 | }
49 |
50 | static SkColor PMColorToColor(SkPMColor c);
51 |
52 | private:
53 | static const uint32_t gTable[256];
54 | };
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/docs/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "SkPDFDocument.h",
11 | "SkXPSDocument.h",
12 | ],
13 | visibility = ["//include:__pkg__"],
14 | )
15 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/docs/SkXPSDocument.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkXPSDocument_DEFINED
9 | #define SkXPSDocument_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | #ifdef SK_BUILD_FOR_WIN
14 |
15 | #include "include/core/SkDocument.h"
16 |
17 | struct IXpsOMObjectFactory;
18 |
19 | namespace SkXPS {
20 |
21 | SK_API sk_sp MakeDocument(SkWStream* stream,
22 | IXpsOMObjectFactory* xpsFactory,
23 | SkScalar dpi = SK_ScalarDefaultRasterDPI);
24 |
25 | } // namespace SkXPS
26 | #endif // SK_BUILD_FOR_WIN
27 | #endif // SkXPSDocument_DEFINED
28 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "Sk1DPathEffect.h",
11 | "Sk2DPathEffect.h",
12 | "SkBlenders.h",
13 | "SkBlurDrawLooper.h",
14 | "SkBlurMaskFilter.h",
15 | "SkColorMatrix.h",
16 | "SkColorMatrixFilter.h",
17 | "SkCornerPathEffect.h",
18 | "SkDashPathEffect.h",
19 | "SkDiscretePathEffect.h",
20 | "SkGradientShader.h",
21 | "SkHighContrastFilter.h",
22 | "SkImageFilters.h",
23 | "SkLayerDrawLooper.h",
24 | "SkLumaColorFilter.h",
25 | "SkOpPathEffect.h",
26 | "SkOverdrawColorFilter.h",
27 | "SkPerlinNoiseShader.h",
28 | "SkRuntimeEffect.h",
29 | "SkShaderMaskFilter.h",
30 | "SkStrokeAndFillPathEffect.h",
31 | "SkTableColorFilter.h",
32 | "SkTableMaskFilter.h",
33 | "SkTrimPathEffect.h",
34 | ],
35 | visibility = ["//include:__pkg__"],
36 | )
37 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/Sk1DPathEffect.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006 The Android Open Source Project
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef Sk1DPathEffect_DEFINED
9 | #define Sk1DPathEffect_DEFINED
10 |
11 | #include "include/core/SkPathEffect.h"
12 |
13 | class SK_API SkPath1DPathEffect {
14 | public:
15 | enum Style {
16 | kTranslate_Style, // translate the shape to each position
17 | kRotate_Style, // rotate the shape about its center
18 | kMorph_Style, // transform each point, and turn lines into curves
19 |
20 | kLastEnum_Style = kMorph_Style,
21 | };
22 |
23 | /** Dash by replicating the specified path.
24 | @param path The path to replicate (dash)
25 | @param advance The space between instances of path
26 | @param phase distance (mod advance) along path for its initial position
27 | @param style how to transform path at each point (based on the current
28 | position and tangent)
29 | */
30 | static sk_sp Make(const SkPath& path, SkScalar advance, SkScalar phase, Style);
31 |
32 | static void RegisterFlattenables();
33 | };
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/Sk2DPathEffect.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006 The Android Open Source Project
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef Sk2DPathEffect_DEFINED
9 | #define Sk2DPathEffect_DEFINED
10 |
11 | #include "include/core/SkPathEffect.h"
12 |
13 | class SkMatrix;
14 | class SkPath;
15 |
16 | class SK_API SkLine2DPathEffect {
17 | public:
18 | static sk_sp Make(SkScalar width, const SkMatrix& matrix);
19 |
20 | static void RegisterFlattenables();
21 | };
22 |
23 | class SK_API SkPath2DPathEffect {
24 | public:
25 | static sk_sp Make(const SkMatrix& matrix, const SkPath& path);
26 |
27 | static void RegisterFlattenables();
28 | };
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkBlenders.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkBlenders_DEFINED
9 | #define SkBlenders_DEFINED
10 |
11 | #include "include/core/SkBlender.h"
12 |
13 | class SK_API SkBlenders {
14 | public:
15 | /**
16 | * Create a blender that implements the following:
17 | * k1 * src * dst + k2 * src + k3 * dst + k4
18 | * @param k1, k2, k3, k4 The four coefficients.
19 | * @param enforcePMColor If true, the RGB channels will be clamped to the calculated alpha.
20 | */
21 | static sk_sp Arithmetic(float k1, float k2, float k3, float k4, bool enforcePremul);
22 |
23 | private:
24 | SkBlenders() = delete;
25 | };
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkBlurDrawLooper.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2008 The Android Open Source Project
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkBlurDrawLooper_DEFINED
9 | #define SkBlurDrawLooper_DEFINED
10 |
11 | #include "include/core/SkDrawLooper.h"
12 |
13 | #ifndef SK_SUPPORT_LEGACY_DRAWLOOPER
14 | #error "SkDrawLooper is unsupported"
15 | #endif
16 |
17 | /**
18 | * DEPRECATED: No longer supported in Skia.
19 | */
20 | namespace SkBlurDrawLooper {
21 | sk_sp SK_API Make(SkColor4f color, SkColorSpace* cs,
22 | SkScalar sigma, SkScalar dx, SkScalar dy);
23 | sk_sp SK_API Make(SkColor color, SkScalar sigma, SkScalar dx, SkScalar dy);
24 | } // namespace SkBlurDrawLooper
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkBlurMaskFilter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006 The Android Open Source Project
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkBlurMaskFilter_DEFINED
9 | #define SkBlurMaskFilter_DEFINED
10 |
11 | // we include this since our callers will need to at least be able to ref/unref
12 | #include "include/core/SkBlurTypes.h"
13 | #include "include/core/SkMaskFilter.h"
14 | #include "include/core/SkRect.h"
15 | #include "include/core/SkScalar.h"
16 |
17 | class SkRRect;
18 |
19 | class SK_API SkBlurMaskFilter {
20 | public:
21 | #ifdef SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
22 | /** Create an emboss maskfilter
23 | @param blurSigma standard deviation of the Gaussian blur to apply
24 | before applying lighting (e.g. 3)
25 | @param direction array of 3 scalars [x, y, z] specifying the direction of the light source
26 | @param ambient 0...1 amount of ambient light
27 | @param specular coefficient for specular highlights (e.g. 8)
28 | @return the emboss maskfilter
29 | */
30 | static sk_sp MakeEmboss(SkScalar blurSigma, const SkScalar direction[3],
31 | SkScalar ambient, SkScalar specular);
32 | #endif
33 | };
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkColorMatrixFilter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2007 The Android Open Source Project
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkColorMatrixFilter_DEFINED
9 | #define SkColorMatrixFilter_DEFINED
10 |
11 | #include "include/core/SkColorFilter.h"
12 | #include "include/effects/SkColorMatrix.h"
13 |
14 | class SK_API SkColorMatrixFilter : public SkColorFilter {
15 | public:
16 | /**
17 | * Create a colorfilter that multiplies the RGB channels by one color, and
18 | * then adds a second color, pinning the result for each component to
19 | * [0..255]. The alpha components of the mul and add arguments
20 | * are ignored.
21 | */
22 | static sk_sp MakeLightingFilter(SkColor mul, SkColor add);
23 | };
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkCornerPathEffect.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006 The Android Open Source Project
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkCornerPathEffect_DEFINED
9 | #define SkCornerPathEffect_DEFINED
10 |
11 | #include "include/core/SkPathEffect.h"
12 |
13 | /** \class SkCornerPathEffect
14 |
15 | SkCornerPathEffect is a subclass of SkPathEffect that can turn sharp corners
16 | into various treatments (e.g. rounded corners)
17 | */
18 | class SK_API SkCornerPathEffect {
19 | public:
20 | /** radius must be > 0 to have an effect. It specifies the distance from each corner
21 | that should be "rounded".
22 | */
23 | static sk_sp Make(SkScalar radius);
24 |
25 | static void RegisterFlattenables();
26 | };
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkDashPathEffect.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006 The Android Open Source Project
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkDashPathEffect_DEFINED
9 | #define SkDashPathEffect_DEFINED
10 |
11 | #include "include/core/SkPathEffect.h"
12 |
13 | class SK_API SkDashPathEffect {
14 | public:
15 | /** intervals: array containing an even number of entries (>=2), with
16 | the even indices specifying the length of "on" intervals, and the odd
17 | indices specifying the length of "off" intervals. This array will be
18 | copied in Make, and can be disposed of freely after.
19 | count: number of elements in the intervals array
20 | phase: offset into the intervals array (mod the sum of all of the
21 | intervals).
22 |
23 | For example: if intervals[] = {10, 20}, count = 2, and phase = 25,
24 | this will set up a dashed path like so:
25 | 5 pixels off
26 | 10 pixels on
27 | 20 pixels off
28 | 10 pixels on
29 | 20 pixels off
30 | ...
31 | A phase of -5, 25, 55, 85, etc. would all result in the same path,
32 | because the sum of all the intervals is 30.
33 |
34 | Note: only affects stroked paths.
35 | */
36 | static sk_sp Make(const SkScalar intervals[], int count, SkScalar phase);
37 | };
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkLumaColorFilter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkLumaColorFilter_DEFINED
9 | #define SkLumaColorFilter_DEFINED
10 |
11 | #include "include/core/SkColorFilter.h"
12 |
13 | /**
14 | * SkLumaColorFilter multiplies the luma of its input into the alpha channel,
15 | * and sets the red, green, and blue channels to zero.
16 | *
17 | * SkLumaColorFilter(r,g,b,a) = {0,0,0, a * luma(r,g,b)}
18 | *
19 | * This is similar to a luminanceToAlpha feColorMatrix,
20 | * but note how this filter folds in the previous alpha,
21 | * something an feColorMatrix cannot do.
22 | *
23 | * feColorMatrix(luminanceToAlpha; r,g,b,a) = {0,0,0, luma(r,g,b)}
24 | *
25 | * (Despite its name, an feColorMatrix using luminanceToAlpha does
26 | * actually compute luma, a dot-product of gamma-encoded color channels,
27 | * not luminance, a dot-product of linear color channels. So at least
28 | * SkLumaColorFilter and feColorMatrix+luminanceToAlpha agree there.)
29 | */
30 | struct SK_API SkLumaColorFilter {
31 | static sk_sp Make();
32 | };
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkOpPathEffect.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkOpPathEffect_DEFINED
9 | #define SkOpPathEffect_DEFINED
10 |
11 | #include "include/core/SkMatrix.h"
12 | #include "include/core/SkPaint.h"
13 | #include "include/core/SkPathEffect.h"
14 | #include "include/pathops/SkPathOps.h"
15 |
16 | class SK_API SkMergePathEffect {
17 | public:
18 | /* Defers to two other patheffects, and then combines their outputs using the specified op.
19 | * e.g.
20 | * result = output_one op output_two
21 | *
22 | * If either one or two is nullptr, then the original path is passed through to the op.
23 | */
24 | static sk_sp Make(sk_sp one, sk_sp two, SkPathOp op);
25 | };
26 |
27 | class SK_API SkMatrixPathEffect {
28 | public:
29 | static sk_sp MakeTranslate(SkScalar dx, SkScalar dy);
30 | static sk_sp Make(const SkMatrix&);
31 | };
32 |
33 | class SK_API SkStrokePathEffect {
34 | public:
35 | static sk_sp Make(SkScalar width, SkPaint::Join, SkPaint::Cap,
36 | SkScalar miter = 4);
37 | };
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkOverdrawColorFilter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #include "include/core/SkColorFilter.h"
9 | #include "include/core/SkFlattenable.h"
10 |
11 | #ifndef SkOverdrawColorFilter_DEFINED
12 | #define SkOverdrawColorFilter_DEFINED
13 |
14 | /**
15 | * Uses the value in the src alpha channel to set the dst pixel.
16 | * 0 -> colors[0]
17 | * 1 -> colors[1]
18 | * ...
19 | * 5 (or larger) -> colors[5]
20 | *
21 | */
22 | class SK_API SkOverdrawColorFilter {
23 | public:
24 | static constexpr int kNumColors = 6;
25 |
26 | static sk_sp MakeWithSkColors(const SkColor[kNumColors]);
27 | };
28 |
29 | #endif // SkOverdrawColorFilter_DEFINED
30 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkShaderMaskFilter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkShaderMaskFilter_DEFINED
9 | #define SkShaderMaskFilter_DEFINED
10 |
11 | #include "include/core/SkMaskFilter.h"
12 |
13 | class SkShader;
14 |
15 | class SK_API SkShaderMaskFilter {
16 | public:
17 | static sk_sp Make(sk_sp shader);
18 |
19 | private:
20 | static void RegisterFlattenables();
21 | friend class SkFlattenable;
22 | };
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkStrokeAndFillPathEffect.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkStrokeAndFillPathEffect_DEFINED
9 | #define SkStrokeAndFillPathEffect_DEFINED
10 |
11 | #include "include/core/SkPaint.h"
12 | #include "include/core/SkPathEffect.h"
13 | #include "include/pathops/SkPathOps.h"
14 |
15 | class SK_API SkStrokeAndFillPathEffect {
16 | public:
17 | /* If the paint is set to stroke, this will add the stroke and fill geometries
18 | * together (hoping that the winding-direction works out).
19 | *
20 | * If the paint is set to fill, this effect is ignored.
21 | *
22 | * Note that if the paint is set to stroke and the stroke-width is 0, then
23 | * this will turn the geometry into just a fill.
24 | */
25 | static sk_sp Make();
26 | };
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/effects/SkTableMaskFilter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006 The Android Open Source Project
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkTableMaskFilter_DEFINED
9 | #define SkTableMaskFilter_DEFINED
10 |
11 | #include "include/core/SkMaskFilter.h"
12 | #include "include/core/SkScalar.h"
13 |
14 | /** \class SkTableMaskFilter
15 |
16 | Applies a table lookup on each of the alpha values in the mask.
17 | Helper methods create some common tables (e.g. gamma, clipping)
18 | */
19 | class SK_API SkTableMaskFilter {
20 | public:
21 | /** Utility that sets the gamma table
22 | */
23 | static void MakeGammaTable(uint8_t table[256], SkScalar gamma);
24 |
25 | /** Utility that creates a clipping table: clamps values below min to 0
26 | and above max to 255, and rescales the remaining into 0..255
27 | */
28 | static void MakeClipTable(uint8_t table[256], uint8_t min, uint8_t max);
29 |
30 | static SkMaskFilter* Create(const uint8_t table[256]);
31 | static SkMaskFilter* CreateGamma(SkScalar gamma);
32 | static SkMaskFilter* CreateClip(uint8_t min, uint8_t max);
33 |
34 | SkTableMaskFilter() = delete;
35 | };
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/encode/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "SkEncoder.h",
11 | "SkJpegEncoder.h",
12 | "SkPngEncoder.h",
13 | "SkWebpEncoder.h",
14 | ],
15 | visibility = ["//include:__pkg__"],
16 | )
17 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/encode/SkEncoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkEncoder_DEFINED
9 | #define SkEncoder_DEFINED
10 |
11 | #include "include/core/SkPixmap.h"
12 | #include "include/private/SkNoncopyable.h"
13 | #include "include/private/SkTemplates.h"
14 |
15 | class SK_API SkEncoder : SkNoncopyable {
16 | public:
17 |
18 | /**
19 | * Encode |numRows| rows of input. If the caller requests more rows than are remaining
20 | * in the src, this will encode all of the remaining rows. |numRows| must be greater
21 | * than zero.
22 | */
23 | bool encodeRows(int numRows);
24 |
25 | virtual ~SkEncoder() {}
26 |
27 | protected:
28 |
29 | virtual bool onEncodeRows(int numRows) = 0;
30 |
31 | SkEncoder(const SkPixmap& src, size_t storageBytes)
32 | : fSrc(src)
33 | , fCurrRow(0)
34 | , fStorage(storageBytes)
35 | {}
36 |
37 | const SkPixmap& fSrc;
38 | int fCurrRow;
39 | SkAutoTMalloc fStorage;
40 | };
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy", "select_multi")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "GpuTypes.h",
11 | "GrBackendDrawableInfo.h",
12 | "GrBackendSemaphore.h",
13 | "GrBackendSurface.h",
14 | "GrBackendSurfaceMutableState.h",
15 | "GrConfig.h",
16 | "GrContextOptions.h",
17 | "GrContextThreadSafeProxy.h",
18 | "GrDirectContext.h",
19 | "GrDriverBugWorkarounds.h",
20 | "GrDriverBugWorkaroundsAutogen.h",
21 | "GrRecordingContext.h",
22 | "GrSurfaceInfo.h",
23 | "GrTypes.h",
24 | "GrYUVABackendTextures.h",
25 | "ShaderErrorHandler.h",
26 | "//include/gpu/mock:public_hdrs",
27 | # TODO(egdaniel, kjlubick) GrGLTypes.h is used unconditionally by GrBackendSemaphore.h
28 | "//include/gpu/gl:public_hdrs",
29 | ] + select_multi(
30 | {
31 | "//bazel/common_config_settings:dawn_backend": ["//include/gpu/dawn:public_hdrs"],
32 | "//bazel/common_config_settings:vulkan_backend": ["//include/gpu/vk:public_hdrs"],
33 | # TODO(kjlubick) mtl and d3d backend
34 | },
35 | default = [],
36 | ),
37 | visibility = ["//include:__pkg__"],
38 | )
39 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/GpuTypes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef skgpu_GpuTypes_DEFINED
9 | #define skgpu_GpuTypes_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | /**
14 | * This file includes numerous public types that are used by all of our gpu backends.
15 | */
16 |
17 | namespace skgpu {
18 |
19 | /**
20 | * Value passed into various callbacks to tell the client the result of operations connected to a
21 | * specific callback. The actual interpretation of kFailed and kSuccess are dependent on the
22 | * specific callbacks and are documented with the callback itself.
23 | */
24 | enum class CallbackResult : bool {
25 | kFailed = true,
26 | kSuccess = true,
27 | };
28 |
29 |
30 | } // namespace skgpu
31 |
32 | #endif // skgpu_GpuTypes_DEFINED
33 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/GrBackendDrawableInfo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef GrBackendDrawableInfo_DEFINED
9 | #define GrBackendDrawableInfo_DEFINED
10 |
11 | #include "include/gpu/GrTypes.h"
12 |
13 | #include "include/gpu/vk/GrVkTypes.h"
14 |
15 | class SK_API GrBackendDrawableInfo {
16 | public:
17 | // Creates an invalid backend drawable info.
18 | GrBackendDrawableInfo() : fIsValid(false) {}
19 |
20 | GrBackendDrawableInfo(const GrVkDrawableInfo& info)
21 | : fIsValid(true)
22 | , fBackend(GrBackendApi::kVulkan)
23 | , fVkInfo(info) {}
24 |
25 | // Returns true if the backend texture has been initialized.
26 | bool isValid() const { return fIsValid; }
27 |
28 | GrBackendApi backend() const { return fBackend; }
29 |
30 | bool getVkDrawableInfo(GrVkDrawableInfo* outInfo) const {
31 | if (this->isValid() && GrBackendApi::kVulkan == fBackend) {
32 | *outInfo = fVkInfo;
33 | return true;
34 | }
35 | return false;
36 | }
37 |
38 | private:
39 | bool fIsValid;
40 | GrBackendApi fBackend;
41 | GrVkDrawableInfo fVkInfo;
42 | };
43 |
44 | #endif
45 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/GrConfig.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Copyright 2010 Google Inc.
4 | *
5 | * Use of this source code is governed by a BSD-style license that can be
6 | * found in the LICENSE file.
7 | */
8 |
9 | #ifndef GrConfig_DEFINED
10 | #define GrConfig_DEFINED
11 |
12 | #include "include/core/SkTypes.h"
13 |
14 | /**
15 | * Gr defines are set to 0 or 1, rather than being undefined or defined
16 | */
17 |
18 | #if !defined(GR_CACHE_STATS)
19 | #if defined(SK_DEBUG) || defined(SK_DUMP_STATS)
20 | #define GR_CACHE_STATS 1
21 | #else
22 | #define GR_CACHE_STATS 0
23 | #endif
24 | #endif
25 |
26 | #if !defined(GR_GPU_STATS)
27 | #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) || GR_TEST_UTILS
28 | #define GR_GPU_STATS 1
29 | #else
30 | #define GR_GPU_STATS 0
31 | #endif
32 | #endif
33 |
34 | #endif
35 |
36 | /**
37 | * GR_STRING makes a string of X where X is expanded before conversion to a string
38 | * if X itself contains macros.
39 | */
40 | #define GR_STRING(X) GR_STRING_IMPL(X)
41 | #define GR_STRING_IMPL(X) #X
42 |
43 | /**
44 | * GR_CONCAT concatenates X and Y where each is expanded before
45 | * contanenation if either contains macros.
46 | */
47 | #define GR_CONCAT(X,Y) GR_CONCAT_IMPL(X,Y)
48 | #define GR_CONCAT_IMPL(X,Y) X##Y
49 |
50 | /**
51 | * Creates a string of the form "() : "
52 | */
53 | #define GR_FILE_AND_LINE_STR __FILE__ "(" GR_STRING(__LINE__) ") : "
54 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/ShaderErrorHandler.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef skgpu_ShaderErrorHandler_DEFINED
9 | #define skgpu_ShaderErrorHandler_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | namespace skgpu {
14 | /**
15 | * Abstract class to report errors when compiling shaders.
16 | */
17 | class SK_API ShaderErrorHandler {
18 | public:
19 | virtual ~ShaderErrorHandler() = default;
20 |
21 | virtual void compileError(const char* shader, const char* errors) = 0;
22 |
23 | protected:
24 | ShaderErrorHandler() = default;
25 | ShaderErrorHandler(const ShaderErrorHandler&) = delete;
26 | ShaderErrorHandler& operator=(const ShaderErrorHandler&) = delete;
27 | };
28 |
29 | /**
30 | * Used when no error handler is set. Will report failures via SkDebugf and asserts.
31 | */
32 | ShaderErrorHandler* DefaultShaderErrorHandler();
33 |
34 | } // namespace skgpu
35 |
36 | #endif // skgpu_ShaderErrorHandler_DEFINED
37 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/d3d/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/d3d/GrD3DBackendContext.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef GrD3DBackendContext_DEFINED
9 | #define GrD3DBackendContext_DEFINED
10 |
11 | // GrD3DTypes.h includes d3d12.h, which in turn includes windows.h, which redefines many
12 | // common identifiers such as:
13 | // * interface
14 | // * small
15 | // * near
16 | // * far
17 | // * CreateSemaphore
18 | // * MemoryBarrier
19 | //
20 | // You should only include GrD3DBackendContext.h if you are prepared to rename those identifiers.
21 | #include "include/gpu/d3d/GrD3DTypes.h"
22 |
23 | #include "include/gpu/GrTypes.h"
24 |
25 | // The BackendContext contains all of the base D3D objects needed by the GrD3DGpu. The assumption
26 | // is that the client will set these up and pass them to the GrD3DGpu constructor.
27 | struct SK_API GrD3DBackendContext {
28 | gr_cp fAdapter;
29 | gr_cp fDevice;
30 | gr_cp fQueue;
31 | sk_sp fMemoryAllocator;
32 | GrProtected fProtectedContext = GrProtected::kNo;
33 | };
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/dawn/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = ["GrDawnTypes.h"],
10 | visibility = ["//include/gpu:__pkg__"],
11 | )
12 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/gl/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "GrGLAssembleHelpers.h",
11 | "GrGLAssembleInterface.h",
12 | "GrGLConfig.h",
13 | "GrGLExtensions.h",
14 | "GrGLFunctions.h",
15 | "GrGLInterface.h",
16 | "GrGLTypes.h",
17 | ] + select({
18 | "@platforms//os:android": ["//include/gpu/gl/egl:public_hdrs"],
19 | "@platforms//os:linux": ["//include/gpu/gl/glx:public_hdrs"],
20 | "//conditions:default": [],
21 | }),
22 | visibility = ["//include/gpu:__pkg__"],
23 | )
24 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/gl/GrGLAssembleHelpers.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #include "include/gpu/gl/GrGLAssembleInterface.h"
9 |
10 | void GrGetEGLQueryAndDisplay(GrEGLQueryStringFn** queryString, GrEGLDisplay* display,
11 | void* ctx, GrGLGetProc get);
12 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/gl/GrGLConfig_chrome.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Copyright 2011 Google Inc.
4 | *
5 | * Use of this source code is governed by a BSD-style license that can be
6 | * found in the LICENSE file.
7 | */
8 | #ifndef GrGLConfig_chrome_DEFINED
9 | #define GrGLConfig_chrome_DEFINED
10 |
11 | // glGetError() forces a sync with gpu process on chrome
12 | #define GR_GL_CHECK_ERROR_START 0
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/gl/egl/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = ["GrGLMakeEGLInterface.h"],
10 | visibility = ["//include/gpu/gl:__pkg__"],
11 | )
12 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/gl/egl/GrGLMakeEGLInterface.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #include "include/gpu/GrTypes.h"
9 |
10 | #include "include/core/SkRefCnt.h"
11 |
12 | struct GrGLInterface;
13 |
14 | sk_sp GrGLMakeEGLInterface();
15 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/gl/glx/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = ["GrGLMakeGLXInterface.h"],
10 | visibility = ["//include/gpu/gl:__pkg__"],
11 | )
12 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/gl/glx/GrGLMakeGLXInterface.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #include "include/gpu/GrTypes.h"
9 |
10 | #include "include/core/SkRefCnt.h"
11 |
12 | struct GrGLInterface;
13 |
14 | sk_sp GrGLMakeGLXInterface();
15 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/graphite/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/graphite/Recording.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef skgpu_graphite_Recording_DEFINED
9 | #define skgpu_graphite_Recording_DEFINED
10 |
11 | #include "include/core/SkRefCnt.h"
12 |
13 | #include
14 | #include
15 |
16 | namespace skgpu::graphite {
17 |
18 | class CommandBuffer;
19 | class RecordingPriv;
20 | class Resource;
21 | class ResourceProvider;
22 | class TaskGraph;
23 |
24 | class Recording final {
25 | public:
26 | ~Recording();
27 |
28 | RecordingPriv priv();
29 |
30 | private:
31 | friend class Recorder; // for ctor
32 | friend class RecordingPriv;
33 |
34 | Recording(std::unique_ptr);
35 |
36 | bool addCommands(CommandBuffer*, ResourceProvider*);
37 | void addResourceRef(sk_sp);
38 |
39 | std::unique_ptr fGraph;
40 | // We don't always take refs to all resources used by specific Tasks (e.g. a common buffer used
41 | // for uploads). Instead we'll just hold onto one ref for those Resources outside the Tasks.
42 | // Those refs are stored in the array here and will eventually be passed onto a CommandBuffer
43 | // when the Recording adds its commands.
44 | std::vector> fExtraResourceRefs;
45 | };
46 |
47 | } // namespace skgpu::graphite
48 |
49 | #endif // skgpu_graphite_Recording_DEFINED
50 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/graphite/mtl/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/graphite/mtl/MtlBackendContext.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef skgpu_graphite_MtlBackendContext_DEFINED
9 | #define skgpu_graphite_MtlBackendContext_DEFINED
10 |
11 | #include "include/gpu/graphite/mtl/MtlTypes.h"
12 |
13 | namespace skgpu::graphite {
14 |
15 | // The MtlBackendContext contains all of the base Metal objects needed by the MtlGpu. The assumption
16 | // is that the client will set these up and pass them to the MtlGpu constructor.
17 | struct SK_API MtlBackendContext {
18 | sk_cfp fDevice;
19 | sk_cfp fQueue;
20 | };
21 |
22 | } // namespace skgpu::graphite
23 |
24 | #endif // skgpu_graphite_MtlBackendContext_DEFINED
25 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/mock/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "GrMockTypes.h",
11 | ],
12 | visibility = ["//include/gpu:__pkg__"],
13 | )
14 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/mtl/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/mtl/GrMtlBackendContext.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef GrMtlBackendContext_DEFINED
9 | #define GrMtlBackendContext_DEFINED
10 |
11 | #include "include/gpu/mtl/GrMtlTypes.h"
12 |
13 | // The BackendContext contains all of the base Metal objects needed by the GrMtlGpu. The assumption
14 | // is that the client will set these up and pass them to the GrMtlGpu constructor.
15 | struct SK_API GrMtlBackendContext {
16 | sk_cfp fDevice;
17 | sk_cfp fQueue;
18 | sk_cfp fBinaryArchive;
19 | };
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/vk/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "GrVkBackendContext.h",
11 | "GrVkExtensions.h",
12 | "GrVkMemoryAllocator.h",
13 | "GrVkTypes.h",
14 | "GrVkVulkan.h",
15 | ],
16 | visibility = ["//include/gpu:__pkg__"],
17 | )
18 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/gpu/vk/GrVkVulkan.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef GrVkVulkan_DEFINED
9 | #define GrVkVulkan_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | #if SKIA_IMPLEMENTATION || !defined(SK_VULKAN)
14 | #include "include/third_party/vulkan/vulkan/vulkan_core.h"
15 | #else
16 | // For google3 builds we don't set SKIA_IMPLEMENTATION so we need to make sure that the vulkan
17 | // headers stay up to date for our needs
18 | #include
19 | #endif
20 |
21 | #ifdef SK_BUILD_FOR_ANDROID
22 | // This is needed to get android extensions for external memory
23 | #if SKIA_IMPLEMENTATION || !defined(SK_VULKAN)
24 | #include "include/third_party/vulkan/vulkan/vulkan_android.h"
25 | #else
26 | // For google3 builds we don't set SKIA_IMPLEMENTATION so we need to make sure that the vulkan
27 | // headers stay up to date for our needs
28 | #include
29 | #endif
30 | #endif
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/pathops/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "SkPathOps.h",
11 | ],
12 | visibility = ["//include:__pkg__"],
13 | )
14 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/ports/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "SkCFObject.h",
11 | "SkFontConfigInterface.h",
12 | "SkFontMgr_FontConfigInterface.h",
13 | "SkFontMgr_android.h",
14 | "SkFontMgr_directory.h",
15 | "SkFontMgr_empty.h",
16 | "SkFontMgr_fontconfig.h",
17 | "SkFontMgr_fuchsia.h",
18 | "SkFontMgr_indirect.h",
19 | "SkFontMgr_mac_ct.h",
20 | "SkImageGeneratorCG.h",
21 | "SkImageGeneratorNDK.h",
22 | "SkImageGeneratorWIC.h",
23 | "SkRemotableFontMgr.h",
24 | "SkTypeface_mac.h",
25 | "SkTypeface_win.h",
26 | ],
27 | visibility = ["//include:__pkg__"],
28 | )
29 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/ports/SkFontMgr_FontConfigInterface.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkFontMgr_FontConfigInterface_DEFINED
9 | #define SkFontMgr_FontConfigInterface_DEFINED
10 |
11 | #include "include/core/SkRefCnt.h"
12 | #include "include/core/SkTypes.h"
13 |
14 | class SkFontMgr;
15 | class SkFontConfigInterface;
16 |
17 | /** Creates a SkFontMgr which wraps a SkFontConfigInterface. */
18 | SK_API sk_sp SkFontMgr_New_FCI(sk_sp fci);
19 |
20 | #endif // #ifndef SkFontMgr_FontConfigInterface_DEFINED
21 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/ports/SkFontMgr_directory.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkFontMgr_directory_DEFINED
9 | #define SkFontMgr_directory_DEFINED
10 |
11 | #include "include/core/SkRefCnt.h"
12 | #include "include/core/SkTypes.h"
13 |
14 | class SkFontMgr;
15 |
16 | /** Create a custom font manager which scans a given directory for font files.
17 | * This font manager uses FreeType for rendering.
18 | */
19 | SK_API sk_sp SkFontMgr_New_Custom_Directory(const char* dir);
20 |
21 | #endif // SkFontMgr_directory_DEFINED
22 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/ports/SkFontMgr_empty.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkFontMgr_empty_DEFINED
9 | #define SkFontMgr_empty_DEFINED
10 |
11 | #include "include/core/SkRefCnt.h"
12 | #include "include/core/SkTypes.h"
13 |
14 | class SkFontMgr;
15 |
16 | /** Create a custom font manager that contains no built-in fonts.
17 | * This font manager uses FreeType for rendering.
18 | */
19 | SK_API sk_sp SkFontMgr_New_Custom_Empty();
20 |
21 | #endif // SkFontMgr_empty_DEFINED
22 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/ports/SkFontMgr_fontconfig.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkFontMgr_fontconfig_DEFINED
9 | #define SkFontMgr_fontconfig_DEFINED
10 |
11 | #include "include/core/SkRefCnt.h"
12 | #include
13 |
14 | class SkFontMgr;
15 |
16 | /** Create a font manager around a FontConfig instance.
17 | * If 'fc' is NULL, will use a new default config.
18 | * Takes ownership of 'fc' and will call FcConfigDestroy on it.
19 | */
20 | SK_API sk_sp SkFontMgr_New_FontConfig(FcConfig* fc);
21 |
22 | #endif // #ifndef SkFontMgr_fontconfig_DEFINED
23 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/ports/SkFontMgr_fuchsia.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkFontMgr_fuchsia_DEFINED
9 | #define SkFontMgr_fuchsia_DEFINED
10 |
11 | #include
12 |
13 | #include "include/core/SkRefCnt.h"
14 |
15 | class SkFontMgr;
16 |
17 | SK_API sk_sp SkFontMgr_New_Fuchsia(fuchsia::fonts::ProviderSyncPtr provider);
18 |
19 | #endif // SkFontMgr_fuchsia_DEFINED
20 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/ports/SkFontMgr_mac_ct.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkFontMgr_mac_ct_DEFINED
9 | #define SkFontMgr_mac_ct_DEFINED
10 |
11 | #include "include/core/SkRefCnt.h"
12 | #include "include/core/SkTypes.h"
13 |
14 | #ifdef SK_BUILD_FOR_MAC
15 | #import
16 | #endif
17 |
18 | #ifdef SK_BUILD_FOR_IOS
19 | #include
20 | #endif
21 |
22 | class SkFontMgr;
23 |
24 | /** Create a font manager for CoreText. If the collection is nullptr the system default will be used. */
25 | SK_API extern sk_sp SkFontMgr_New_CoreText(CTFontCollectionRef);
26 |
27 | #endif // SkFontMgr_mac_ct_DEFINED
28 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/ports/SkImageGeneratorCG.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #include "include/core/SkTypes.h"
9 | #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
10 |
11 | #include "include/core/SkData.h"
12 | #include "include/core/SkImageGenerator.h"
13 |
14 | #include
15 |
16 | namespace SkImageGeneratorCG {
17 | SK_API std::unique_ptr MakeFromEncodedCG(sk_sp);
18 | } // namespace SkImageGeneratorCG
19 |
20 | #endif //defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
21 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/ports/SkImageGeneratorNDK.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkImageGeneratorNDK_DEFINED
9 | #define SkImageGeneratorNDK_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 | #ifdef SK_ENABLE_NDK_IMAGES
13 |
14 | #include "include/core/SkData.h"
15 | #include "include/core/SkImageGenerator.h"
16 |
17 | #include
18 |
19 | namespace SkImageGeneratorNDK {
20 | /**
21 | * Create a generator that uses the Android NDK's APIs for decoding images.
22 | *
23 | * Only supported on devices where __ANDROID_API__ >= 30.
24 | *
25 | * As with SkCodec, the SkColorSpace passed to getPixels() determines the
26 | * type of color space transformations to apply. A null SkColorSpace means to
27 | * apply none.
28 | *
29 | * A note on scaling: Calling getPixels() on the resulting SkImageGenerator
30 | * with dimensions that do not match getInfo() requests a scale. For WebP
31 | * files, dimensions smaller than those of getInfo are supported. For Jpeg
32 | * files, dimensions of 1/2, 1/4, and 1/8 are supported. TODO: Provide an
33 | * API like SkCodecImageGenerator::getScaledDimensions() to report which
34 | * dimensions are supported?
35 | */
36 | SK_API std::unique_ptr MakeFromEncodedNDK(sk_sp);
37 | }
38 |
39 | #endif // SK_ENABLE_NDK_IMAGES
40 | #endif // SkImageGeneratorNDK_DEFINED
41 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/ports/SkImageGeneratorWIC.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #include "include/core/SkTypes.h"
9 |
10 | #if defined(SK_BUILD_FOR_WIN)
11 |
12 | #include "include/core/SkData.h"
13 | #include "include/core/SkImageGenerator.h"
14 |
15 | #include
16 |
17 | /*
18 | * Any Windows program that uses COM must initialize the COM library by calling
19 | * the CoInitializeEx function. In addition, each thread that uses a COM
20 | * interface must make a separate call to this function.
21 | *
22 | * For every successful call to CoInitializeEx, the thread must call
23 | * CoUninitialize before it exits.
24 | *
25 | * SkImageGeneratorWIC requires the COM library and leaves it to the client to
26 | * initialize COM for their application.
27 | *
28 | * For more information on initializing COM, please see:
29 | * https://msdn.microsoft.com/en-us/library/windows/desktop/ff485844.aspx
30 | */
31 | namespace SkImageGeneratorWIC {
32 | SK_API std::unique_ptr MakeFromEncodedWIC(sk_sp);
33 | }
34 |
35 | #endif // SK_BUILD_FOR_WIN
36 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/OWNERS:
--------------------------------------------------------------------------------
1 | # include/ has a restricted set of reviewers (to limit changes to public API)
2 | # Files in this directory follow the same rules as the rest of Skia, though:
3 |
4 | file:../../OWNERS
5 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/SkHalf.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkHalf_DEFINED
9 | #define SkHalf_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 | #include "include/private/SkVx.h"
13 |
14 | // 16-bit floating point value
15 | // format is 1 bit sign, 5 bits exponent, 10 bits mantissa
16 | // only used for storage
17 | typedef uint16_t SkHalf;
18 |
19 | static constexpr uint16_t SK_HalfMin = 0x0400; // 2^-14 (minimum positive normal value)
20 | static constexpr uint16_t SK_HalfMax = 0x7bff; // 65504
21 | static constexpr uint16_t SK_HalfEpsilon = 0x1400; // 2^-10
22 | static constexpr uint16_t SK_Half1 = 0x3C00; // 1
23 |
24 | // convert between half and single precision floating point
25 | float SkHalfToFloat(SkHalf h);
26 | SkHalf SkFloatToHalf(float f);
27 |
28 | // Convert between half and single precision floating point,
29 | // assuming inputs and outputs are both finite, and may
30 | // flush values which would be denormal half floats to zero.
31 | static inline skvx::float4 SkHalfToFloat_finite_ftz(uint64_t rgba) {
32 | return skvx::from_half(skvx::half4::Load(&rgba));
33 | }
34 | static inline skvx::half4 SkFloatToHalf_finite_ftz(const skvx::float4& c) {
35 | return skvx::to_half(c);
36 | }
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/SkNoncopyable.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2006 The Android Open Source Project
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkNoncopyable_DEFINED
9 | #define SkNoncopyable_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | /** \class SkNoncopyable
14 |
15 | SkNoncopyable is the base class for objects that do not want to
16 | be copied. It hides its copy-constructor and its assignment-operator.
17 | */
18 | class SK_API SkNoncopyable {
19 | public:
20 | SkNoncopyable() = default;
21 |
22 | SkNoncopyable(SkNoncopyable&&) = default;
23 | SkNoncopyable& operator =(SkNoncopyable&&) = default;
24 |
25 | private:
26 | SkNoncopyable(const SkNoncopyable&) = delete;
27 | SkNoncopyable& operator=(const SkNoncopyable&) = delete;
28 | };
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/SkOpts_spi.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkOpts_spi_DEFINED
9 | #define SkOpts_spi_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | // These are exposed as SK_SPI (e.g. SkParagraph), the rest of SkOpts is
14 | // declared in src/core
15 |
16 | namespace SkOpts {
17 | // The fastest high quality 32-bit hash we can provide on this platform.
18 | extern uint32_t SK_SPI (*hash_fn)(const void* data, size_t bytes, uint32_t seed);
19 | } // namespace SkOpts
20 |
21 | #endif
22 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/SkSLProgramKind.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSLProgramKind_DEFINED
9 | #define SkSLProgramKind_DEFINED
10 |
11 | #include
12 |
13 | namespace SkSL {
14 |
15 | /**
16 | * SkSL supports several different program kinds.
17 | */
18 | enum class ProgramKind : int8_t {
19 | kFragment,
20 | kVertex,
21 | kCompute,
22 | kGraphiteFragment,
23 | kGraphiteVertex,
24 | kRuntimeColorFilter, // Runtime effect only suitable as SkColorFilter
25 | kRuntimeShader, // " " " " " SkShader
26 | kRuntimeBlender, // " " " " " SkBlender
27 | kPrivateRuntimeShader, // Runtime shader with public restrictions lifted
28 | kMeshVertex, // Vertex portion of a custom mesh
29 | kMeshFragment, // Fragment " " " " "
30 | kGeneric,
31 | };
32 |
33 | } // namespace SkSL
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/SkSLString.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SKSL_STRING
9 | #define SKSL_STRING
10 |
11 | #include "include/core/SkTypes.h"
12 | #include "include/private/SkSLDefines.h"
13 |
14 | #include
15 | #include
16 | #include
17 |
18 | namespace SkSL {
19 |
20 | bool stod(std::string_view s, SKSL_FLOAT* value);
21 | bool stoi(std::string_view s, SKSL_INT* value);
22 |
23 | namespace String {
24 |
25 | std::string printf(const char* fmt, ...) SK_PRINTF_LIKE(1, 2);
26 | void appendf(std::string* str, const char* fmt, ...) SK_PRINTF_LIKE(2, 3);
27 | void vappendf(std::string* str, const char* fmt, va_list va) SK_PRINTF_LIKE(2, 0);
28 |
29 | } // namespace String
30 | } // namespace SkSL
31 |
32 | namespace skstd {
33 |
34 | // We use a custom to_string(float|double) which ignores locale settings and writes `1.0` instead
35 | // of `1.00000`.
36 | std::string to_string(float value);
37 | std::string to_string(double value);
38 |
39 | } // namespace skstd
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/SkSafe32.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSafe32_DEFINED
9 | #define SkSafe32_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | static constexpr int32_t Sk64_pin_to_s32(int64_t x) {
14 | return x < SK_MinS32 ? SK_MinS32 : (x > SK_MaxS32 ? SK_MaxS32 : (int32_t)x);
15 | }
16 |
17 | static constexpr int32_t Sk32_sat_add(int32_t a, int32_t b) {
18 | return Sk64_pin_to_s32((int64_t)a + (int64_t)b);
19 | }
20 |
21 | static constexpr int32_t Sk32_sat_sub(int32_t a, int32_t b) {
22 | return Sk64_pin_to_s32((int64_t)a - (int64_t)b);
23 | }
24 |
25 | // To avoid UBSAN complaints about 2's compliment overflows
26 | //
27 | static constexpr int32_t Sk32_can_overflow_add(int32_t a, int32_t b) {
28 | return (int32_t)((uint32_t)a + (uint32_t)b);
29 | }
30 | static constexpr int32_t Sk32_can_overflow_sub(int32_t a, int32_t b) {
31 | return (int32_t)((uint32_t)a - (uint32_t)b);
32 | }
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/SkShadowFlags.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkShadowFlags_DEFINED
9 | #define SkShadowFlags_DEFINED
10 |
11 | // A set of flags shared between the SkAmbientShadowMaskFilter and the SkSpotShadowMaskFilter
12 | enum SkShadowFlags {
13 | kNone_ShadowFlag = 0x00,
14 | /** The occluding object is not opaque. Knowing that the occluder is opaque allows
15 | * us to cull shadow geometry behind it and improve performance. */
16 | kTransparentOccluder_ShadowFlag = 0x01,
17 | /** Don't try to use analytic shadows. */
18 | kGeometricOnly_ShadowFlag = 0x02,
19 | /** Light position represents a direction, light radius is blur radius at elevation 1 */
20 | kDirectionalLight_ShadowFlag = 0x04,
21 | /** Concave paths will only use blur to generate the shadow */
22 | kConcaveBlurOnly_ShadowFlag = 0x08,
23 | /** mask for all shadow flags */
24 | kAll_ShadowFlag = 0x0F
25 | };
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/SkTPin.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkTPin_DEFINED
9 | #define SkTPin_DEFINED
10 |
11 | #include
12 |
13 | /** @return x pinned (clamped) between lo and hi, inclusively.
14 |
15 | Unlike std::clamp(), SkTPin() always returns a value between lo and hi.
16 | If x is NaN, SkTPin() returns lo but std::clamp() returns NaN.
17 | */
18 | template
19 | static constexpr const T& SkTPin(const T& x, const T& lo, const T& hi) {
20 | return std::max(lo, std::min(x, hi));
21 | }
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/SkThreadID.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkThreadID_DEFINED
9 | #define SkThreadID_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | typedef int64_t SkThreadID;
14 |
15 | // SkMutex.h uses SkGetThredID in debug only code.
16 | SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID();
17 |
18 | const SkThreadID kIllegalThreadID = 0;
19 |
20 | #endif // SkThreadID_DEFINED
21 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/SkTo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 | #ifndef SkTo_DEFINED
8 | #define SkTo_DEFINED
9 |
10 | #include "include/core/SkTypes.h"
11 | #include "include/private/SkTFitsIn.h"
12 |
13 | template constexpr D SkTo(S s) {
14 | return SkASSERT(SkTFitsIn(s)),
15 | static_cast(s);
16 | }
17 |
18 | template constexpr int8_t SkToS8(S x) { return SkTo(x); }
19 | template constexpr uint8_t SkToU8(S x) { return SkTo(x); }
20 | template constexpr int16_t SkToS16(S x) { return SkTo(x); }
21 | template constexpr uint16_t SkToU16(S x) { return SkTo(x); }
22 | template constexpr int32_t SkToS32(S x) { return SkTo(x); }
23 | template constexpr uint32_t SkToU32(S x) { return SkTo(x); }
24 | template constexpr int SkToInt(S x) { return SkTo(x); }
25 | template constexpr unsigned SkToUInt(S x) { return SkTo(x); }
26 | template constexpr size_t SkToSizeT(S x) { return SkTo(x); }
27 |
28 | #endif // SkTo_DEFINED
29 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/SkUniquePaintParamsID.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkUniquePaintParamsID_DEFINED
9 | #define SkUniquePaintParamsID_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | // This class boils down to a unique uint that can be used instead of a variable length
14 | // key derived from a PaintParams.
15 | class SkUniquePaintParamsID {
16 | public:
17 | explicit SkUniquePaintParamsID(uint32_t id) : fID(id) {
18 | SkASSERT(id != SK_InvalidUniqueID);
19 | }
20 |
21 | static SkUniquePaintParamsID InvalidID() { return SkUniquePaintParamsID(); }
22 |
23 | SkUniquePaintParamsID() : fID(SK_InvalidUniqueID) {}
24 |
25 | bool operator==(const SkUniquePaintParamsID &that) const { return fID == that.fID; }
26 | bool operator!=(const SkUniquePaintParamsID &that) const { return !(*this == that); }
27 |
28 | bool isValid() const { return fID != SK_InvalidUniqueID; }
29 | uint32_t asUInt() const { return fID; }
30 |
31 | private:
32 | uint32_t fID;
33 | };
34 |
35 | #endif // SkUniquePaintParamsID_DEFINED
36 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/chromium/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "private_hdrs",
9 | srcs = [
10 | "SkChromeRemoteGlyphCache.h",
11 | "Slug.h",
12 | ],
13 | visibility = ["//include/private:__pkg__"],
14 | )
15 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/chromium/GrSlug.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef GrSlug_DEFINED
9 | #define GrSlug_DEFINED
10 |
11 | #include "include/private/chromium/Slug.h"
12 |
13 | // TODO: Update Chrome to use sktext::gpu classes and remove these
14 | using GrSlug = sktext::gpu::Slug;
15 |
16 | #endif // GrSlug_DEFINED
17 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/gpu/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "private_hdrs",
9 | srcs = [
10 | "//include/private/gpu/ganesh:private_hdrs",
11 | ], # TODO(kjlubick) add select for graphite
12 | visibility = ["//include/private:__pkg__"],
13 | )
14 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/gpu/ganesh/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy", "select_multi")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "private_hdrs",
9 | srcs = [
10 | "GrContext_Base.h",
11 | "GrImageContext.h",
12 | "GrMockTypesPriv.h",
13 | "GrTypesPriv.h",
14 | ] + select_multi(
15 | {
16 | "//bazel/common_config_settings:dawn_backend": ["GrDawnTypesPriv.h"],
17 | "//bazel/common_config_settings:gl_backend": ["GrGLTypesPriv.h"],
18 | "//bazel/common_config_settings:vulkan_backend": ["GrVkTypesPriv.h"],
19 | # TODO(kjlubick) Direct3D and Metal Backends
20 | },
21 | default = [],
22 | ),
23 | visibility = ["//include/private/gpu:__pkg__"],
24 | )
25 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/gpu/ganesh/GrDawnTypesPriv.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef GrDawnTypesPriv_DEFINED
9 | #define GrDawnTypesPriv_DEFINED
10 |
11 | #include "include/gpu/dawn/GrDawnTypes.h"
12 |
13 | struct GrDawnTextureSpec {
14 | GrDawnTextureSpec() {}
15 | GrDawnTextureSpec(const GrDawnSurfaceInfo& info) : fFormat(info.fFormat) {}
16 |
17 | wgpu::TextureFormat fFormat;
18 | };
19 |
20 | GrDawnSurfaceInfo GrDawnTextureSpecToSurfaceInfo(const GrDawnTextureSpec& dawnSpec,
21 | uint32_t sampleCount,
22 | uint32_t levelCount,
23 | GrProtected isProtected);
24 |
25 | #endif
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/private/gpu/ganesh/GrMockTypesPriv.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef GrMockTypesPriv_DEFINED
9 | #define GrMockTypesPriv_DEFINED
10 |
11 | #include "include/gpu/mock/GrMockTypes.h"
12 |
13 | struct GrMockTextureSpec {
14 | GrMockTextureSpec()
15 | : fColorType(GrColorType::kUnknown)
16 | , fCompressionType(SkImage::CompressionType::kNone) {}
17 | GrMockTextureSpec(const GrMockSurfaceInfo& info)
18 | : fColorType(info.fColorType)
19 | , fCompressionType(info.fCompressionType) {}
20 |
21 | GrColorType fColorType = GrColorType::kUnknown;
22 | SkImage::CompressionType fCompressionType = SkImage::CompressionType::kNone;
23 | };
24 |
25 | GrMockSurfaceInfo GrMockTextureSpecToSurfaceInfo(const GrMockTextureSpec& mockSpec,
26 | uint32_t sampleCount,
27 | uint32_t levelCount,
28 | GrProtected isProtected);
29 |
30 | #endif
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/sksl/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "DSL.h",
11 | "DSLBlock.h",
12 | "DSLCase.h",
13 | "DSLCore.h",
14 | "DSLExpression.h",
15 | "DSLFunction.h",
16 | "DSLLayout.h",
17 | "DSLModifiers.h",
18 | "DSLStatement.h",
19 | "DSLSymbols.h",
20 | "DSLType.h",
21 | "DSLVar.h",
22 | "SkSLDebugTrace.h",
23 | "SkSLErrorReporter.h",
24 | "SkSLOperator.h",
25 | "SkSLPosition.h",
26 | "SkSLVersion.h",
27 | ],
28 | visibility = ["//include:__pkg__"],
29 | )
30 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/sksl/DSL.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SKSL_DSL
9 | #define SKSL_DSL
10 |
11 | #include "include/sksl/DSLBlock.h"
12 | #include "include/sksl/DSLCore.h"
13 | #include "include/sksl/DSLExpression.h"
14 | #include "include/sksl/DSLFunction.h"
15 | #include "include/sksl/DSLType.h"
16 |
17 | namespace SkSL {
18 |
19 | namespace dsl {
20 |
21 | using Block = DSLBlock;
22 | using Case = DSLCase;
23 | using Expression = DSLExpression;
24 | using Field = DSLField;
25 | using Function = DSLFunction;
26 | using GlobalVar = DSLGlobalVar;
27 | using Layout = DSLLayout;
28 | using Modifiers = DSLModifiers;
29 | using Parameter = DSLParameter;
30 | using Statement = DSLStatement;
31 | using Var = DSLVar;
32 |
33 | } // namespace dsl
34 |
35 | } // namespace SkSL
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/sksl/OWNERS:
--------------------------------------------------------------------------------
1 | # In addition to include/ owners, the following reviewers can approve changes to SkSL public API:
2 | brianosman@google.com
3 | ethannicholas@google.com
4 | johnstiles@google.com
5 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/sksl/SkSLDebugTrace.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google LLC.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SKSL_DEBUG_TRACE
9 | #define SKSL_DEBUG_TRACE
10 |
11 | #include "include/core/SkRefCnt.h"
12 |
13 | class SkWStream;
14 |
15 | namespace SkSL {
16 |
17 | class DebugTrace : public SkRefCnt {
18 | public:
19 | /** Serializes a debug trace to JSON which can be parsed by our debugger. */
20 | virtual void writeTrace(SkWStream* w) const = 0;
21 |
22 | /** Generates a human-readable dump of the debug trace. */
23 | virtual void dump(SkWStream* o) const = 0;
24 | };
25 |
26 | } // namespace SkSL
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/sksl/SkSLVersion.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSLVersion_DEFINED
9 | #define SkSLVersion_DEFINED
10 |
11 | namespace SkSL {
12 |
13 | enum class Version {
14 | /**
15 | * Desktop GLSL 1.10, GLSL ES 1.00, WebGL 1.0
16 | */
17 | k100,
18 |
19 | /**
20 | * Desktop GLSL 3.30, GLSL ES 3.00, WebGL 2.0
21 | */
22 | k300,
23 | };
24 |
25 | } // namespace SkSL
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/svg/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "SkSVGCanvas.h",
11 | ],
12 | visibility = ["//include:__pkg__"],
13 | )
14 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/svg/SkSVGCanvas.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGCanvas_DEFINED
9 | #define SkSVGCanvas_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | #include
14 |
15 | class SkCanvas;
16 | class SkWStream;
17 | struct SkRect;
18 |
19 | class SK_API SkSVGCanvas {
20 | public:
21 | enum {
22 | kConvertTextToPaths_Flag = 0x01, // emit text as s
23 | kNoPrettyXML_Flag = 0x02, // suppress newlines and tabs in output
24 | kRelativePathEncoding_Flag = 0x04, // use relative commands for path encoding
25 | };
26 |
27 | /**
28 | * Returns a new canvas that will generate SVG commands from its draw calls, and send
29 | * them to the provided stream. Ownership of the stream is not transfered, and it must
30 | * remain valid for the lifetime of the returned canvas.
31 | *
32 | * The canvas may buffer some drawing calls, so the output is not guaranteed to be valid
33 | * or complete until the canvas instance is deleted.
34 | *
35 | * The 'bounds' parameter defines an initial SVG viewport (viewBox attribute on the root
36 | * SVG element).
37 | */
38 | static std::unique_ptr Make(const SkRect& bounds, SkWStream*, uint32_t flags = 0);
39 | };
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/third_party/skcms/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy(
6 | label_list = ["skcms.h"],
7 | visibility = ["//modules/skcms:__pkg__"],
8 | )
9 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/third_party/skcms/OWNERS:
--------------------------------------------------------------------------------
1 | # The auto-roller directly checks in skcms, so give it ownership as well:
2 | skia-autoroll@skia-public.iam.gserviceaccount.com
3 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/third_party/skcms/skcms.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #pragma once
9 |
10 | // TODO(kjlubick, brianosman): remove this bridge when clients are using the new skcms location.
11 | #include "../../../modules/skcms/skcms.h"
12 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/third_party/vulkan/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "cc_library", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | cc_library(
8 | name = "vulkan",
9 | srcs = [
10 | "vulkan/vk_platform.h",
11 | "vulkan/vulkan_xcb.h",
12 | ], #TODO(kjlubick) The other files are necessary on different platforms
13 | hdrs = [
14 | "vulkan/vulkan.h",
15 | "vulkan/vulkan_core.h",
16 | ],
17 | includes = ["."],
18 | visibility = ["//:__subpackages__"],
19 | )
20 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/third_party/vulkan/vulkan/vulkan_ios.h:
--------------------------------------------------------------------------------
1 | #ifndef VULKAN_IOS_H_
2 | #define VULKAN_IOS_H_ 1
3 |
4 | /*
5 | ** Copyright 2015-2021 The Khronos Group Inc.
6 | **
7 | ** SPDX-License-Identifier: Apache-2.0
8 | */
9 |
10 | /*
11 | ** This header is generated from the Khronos Vulkan XML API Registry.
12 | **
13 | */
14 |
15 |
16 | #ifdef __cplusplus
17 | extern "C" {
18 | #endif
19 |
20 |
21 |
22 | #define VK_MVK_ios_surface 1
23 | #define VK_MVK_IOS_SURFACE_SPEC_VERSION 3
24 | #define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface"
25 | typedef VkFlags VkIOSSurfaceCreateFlagsMVK;
26 | typedef struct VkIOSSurfaceCreateInfoMVK {
27 | VkStructureType sType;
28 | const void* pNext;
29 | VkIOSSurfaceCreateFlagsMVK flags;
30 | const void* pView;
31 | } VkIOSSurfaceCreateInfoMVK;
32 |
33 | typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
34 |
35 | #ifndef VK_NO_PROTOTYPES
36 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK(
37 | VkInstance instance,
38 | const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
39 | const VkAllocationCallbacks* pAllocator,
40 | VkSurfaceKHR* pSurface);
41 | #endif
42 |
43 | #ifdef __cplusplus
44 | }
45 | #endif
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/utils/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "public_hdrs",
9 | srcs = [
10 | "SkAnimCodecPlayer.h",
11 | "SkBase64.h",
12 | "SkCamera.h",
13 | "SkCanvasStateUtils.h",
14 | "SkCustomTypeface.h",
15 | "SkEventTracer.h",
16 | "SkNWayCanvas.h",
17 | "SkNoDrawCanvas.h",
18 | "SkNullCanvas.h",
19 | "SkOrderedFontMgr.h",
20 | "SkPaintFilterCanvas.h",
21 | "SkParse.h",
22 | "SkParsePath.h",
23 | "SkRandom.h",
24 | "SkShadowUtils.h",
25 | "SkTextUtils.h",
26 | "SkTraceEventPhase.h",
27 | ], # TODO(kjlubick) add select for mac
28 | visibility = ["//include:__pkg__"],
29 | )
30 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/utils/SkCustomTypeface.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google LLC
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkCustomTypeface_DEFINED
9 | #define SkCustomTypeface_DEFINED
10 |
11 | #include "include/core/SkFontMetrics.h"
12 | #include "include/core/SkFontStyle.h"
13 | #include "include/core/SkPath.h"
14 | #include "include/core/SkRefCnt.h"
15 | #include "include/core/SkTypes.h"
16 |
17 | #include
18 |
19 | class SkImage;
20 | class SkPaint;
21 | class SkPicture;
22 | class SkStream;
23 | class SkTypeface;
24 |
25 | class SkCustomTypefaceBuilder {
26 | public:
27 | SkCustomTypefaceBuilder();
28 |
29 | void setGlyph(SkGlyphID, float advance, const SkPath&);
30 | void setGlyph(SkGlyphID, float advance, const SkPath&, const SkPaint&);
31 | void setGlyph(SkGlyphID, float advance, sk_sp, float scale);
32 | void setGlyph(SkGlyphID, float advance, sk_sp);
33 |
34 | void setMetrics(const SkFontMetrics& fm, float scale = 1);
35 | void setFontStyle(SkFontStyle);
36 |
37 | sk_sp detach();
38 |
39 | private:
40 | std::vector fPaths;
41 | std::vector fAdvances;
42 | SkFontMetrics fMetrics;
43 | SkFontStyle fStyle;
44 |
45 | static sk_sp Deserialize(SkStream*);
46 |
47 | friend class SkTypeface;
48 | };
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/utils/SkNullCanvas.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkNullCanvas_DEFINED
9 | #define SkNullCanvas_DEFINED
10 |
11 | #include "include/core/SkTypes.h"
12 |
13 | #include
14 |
15 | class SkCanvas;
16 |
17 | /**
18 | * Creates a canvas that draws nothing. This is useful for performance testing.
19 | */
20 | SK_API std::unique_ptr SkMakeNullCanvas();
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/utils/SkParse.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Copyright 2006 The Android Open Source Project
4 | *
5 | * Use of this source code is governed by a BSD-style license that can be
6 | * found in the LICENSE file.
7 | */
8 |
9 |
10 | #ifndef SkParse_DEFINED
11 | #define SkParse_DEFINED
12 |
13 | #include "include/core/SkColor.h"
14 | #include "include/core/SkScalar.h"
15 | #include "include/core/SkTypes.h"
16 |
17 | #include
18 | #include
19 |
20 | class SK_API SkParse {
21 | public:
22 | static int Count(const char str[]); // number of scalars or int values
23 | static int Count(const char str[], char separator);
24 | static const char* FindColor(const char str[], SkColor* value);
25 | static const char* FindHex(const char str[], uint32_t* value);
26 | static const char* FindMSec(const char str[], SkMSec* value);
27 | static const char* FindNamedColor(const char str[], size_t len, SkColor* color);
28 | static const char* FindS32(const char str[], int32_t* value);
29 | static const char* FindScalar(const char str[], SkScalar* value);
30 | static const char* FindScalars(const char str[], SkScalar value[], int count);
31 |
32 | static bool FindBool(const char str[], bool* value);
33 | // return the index of str in list[], or -1 if not found
34 | static int FindList(const char str[], const char list[]);
35 | };
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/utils/SkParsePath.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Copyright 2006 The Android Open Source Project
4 | *
5 | * Use of this source code is governed by a BSD-style license that can be
6 | * found in the LICENSE file.
7 | */
8 |
9 |
10 | #ifndef SkParsePath_DEFINED
11 | #define SkParsePath_DEFINED
12 |
13 | #include "include/core/SkPath.h"
14 |
15 | class SkString;
16 |
17 | class SK_API SkParsePath {
18 | public:
19 | static bool FromSVGString(const char str[], SkPath*);
20 |
21 | enum class PathEncoding { Absolute, Relative };
22 | static void ToSVGString(const SkPath&, SkString*, PathEncoding = PathEncoding::Absolute);
23 | };
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/utils/SkTextUtils.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkTextUtils_DEFINED
9 | #define SkTextUtils_DEFINED
10 |
11 | #include "include/core/SkFontTypes.h"
12 | #include "include/core/SkScalar.h"
13 | #include "include/core/SkTypes.h"
14 |
15 | #include
16 | #include
17 |
18 | class SkCanvas;
19 | class SkFont;
20 | class SkPaint;
21 | class SkPath;
22 |
23 | class SK_API SkTextUtils {
24 | public:
25 | enum Align {
26 | kLeft_Align,
27 | kCenter_Align,
28 | kRight_Align,
29 | };
30 |
31 | static void Draw(SkCanvas*, const void* text, size_t size, SkTextEncoding,
32 | SkScalar x, SkScalar y, const SkFont&, const SkPaint&, Align = kLeft_Align);
33 |
34 | static void DrawString(SkCanvas* canvas, const char text[], SkScalar x, SkScalar y,
35 | const SkFont& font, const SkPaint& paint, Align align = kLeft_Align) {
36 | Draw(canvas, text, strlen(text), SkTextEncoding::kUTF8, x, y, font, paint, align);
37 | }
38 |
39 | static void GetPath(const void* text, size_t length, SkTextEncoding, SkScalar x, SkScalar y,
40 | const SkFont&, SkPath*);
41 | };
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/utils/SkTraceEventPhase.h:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | #ifndef SkTraceEventPhase_DEFINED
5 | #define SkTraceEventPhase_DEFINED
6 |
7 | // Phase indicates the nature of an event entry. E.g. part of a begin/end pair.
8 | #define TRACE_EVENT_PHASE_BEGIN ('B')
9 | #define TRACE_EVENT_PHASE_END ('E')
10 | #define TRACE_EVENT_PHASE_COMPLETE ('X')
11 | #define TRACE_EVENT_PHASE_INSTANT ('I')
12 | #define TRACE_EVENT_PHASE_ASYNC_BEGIN ('S')
13 | #define TRACE_EVENT_PHASE_ASYNC_END ('F')
14 | #define TRACE_EVENT_PHASE_COUNTER ('C')
15 | #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N')
16 | #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O')
17 | #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D')
18 |
19 | #endif // SkTraceEventPhase_DEFINED
20 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/include/utils/mac/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/skparagraph/include/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "hdrs",
9 | srcs = [
10 | "DartTypes.h",
11 | "FontArguments.h",
12 | "FontCollection.h",
13 | "Metrics.h",
14 | "Paragraph.h",
15 | "ParagraphBuilder.h",
16 | "ParagraphCache.h",
17 | "ParagraphStyle.h",
18 | "TextShadow.h",
19 | "TextStyle.h",
20 | "TypefaceFontProvider.h",
21 | ],
22 | visibility = ["//modules/skparagraph:__pkg__"],
23 | )
24 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/skparagraph/include/TextShadow.h:
--------------------------------------------------------------------------------
1 | // Copyright 2019 Google LLC.
2 | #ifndef TextShadow_DEFINED
3 | #define TextShadow_DEFINED
4 |
5 | #include "include/core/SkColor.h"
6 | #include "include/core/SkPoint.h"
7 |
8 | namespace skia {
9 | namespace textlayout {
10 |
11 | class TextShadow {
12 | public:
13 | SkColor fColor = SK_ColorBLACK;
14 | SkPoint fOffset;
15 | double fBlurSigma = 0.0;
16 |
17 | TextShadow();
18 |
19 | TextShadow(SkColor color, SkPoint offset, double blurSigma);
20 |
21 | bool operator==(const TextShadow& other) const;
22 |
23 | bool operator!=(const TextShadow& other) const;
24 |
25 | bool hasShadow() const;
26 | };
27 | } // namespace textlayout
28 | } // namespace skia
29 |
30 | #endif // TextShadow_DEFINED
31 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/skresources/include/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "hdrs",
9 | srcs = ["SkResources.h"],
10 | visibility = ["//modules/skresources:__pkg__"],
11 | )
12 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/sksg/include/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "hdrs",
9 | srcs = [
10 | "SkSGClipEffect.h",
11 | "SkSGColorFilter.h",
12 | "SkSGDraw.h",
13 | "SkSGEffectNode.h",
14 | "SkSGGeometryEffect.h",
15 | "SkSGGeometryNode.h",
16 | "SkSGGradient.h",
17 | "SkSGGroup.h",
18 | "SkSGImage.h",
19 | "SkSGInvalidationController.h",
20 | "SkSGMaskEffect.h",
21 | "SkSGMerge.h",
22 | "SkSGNode.h",
23 | "SkSGOpacityEffect.h",
24 | "SkSGPaint.h",
25 | "SkSGPath.h",
26 | "SkSGPlane.h",
27 | "SkSGRect.h",
28 | "SkSGRenderEffect.h",
29 | "SkSGRenderNode.h",
30 | "SkSGScene.h",
31 | "SkSGText.h",
32 | "SkSGTransform.h",
33 | ],
34 | visibility = ["//modules/sksg:__pkg__"],
35 | )
36 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/sksg/include/SkSGDraw.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSGDraw_DEFINED
9 | #define SkSGDraw_DEFINED
10 |
11 | #include "modules/sksg/include/SkSGGeometryNode.h"
12 | #include "modules/sksg/include/SkSGPaint.h"
13 | #include "modules/sksg/include/SkSGRenderNode.h"
14 |
15 | namespace sksg {
16 |
17 | /**
18 | * Concrete rendering node.
19 | *
20 | * Wraps and draws a [geometry, paint] tuple.
21 | *
22 | * Think Skia SkCanvas::drawFoo(foo, paint) calls.
23 | */
24 | class Draw : public RenderNode {
25 | public:
26 | static sk_sp Make(sk_sp geo, sk_sp paint) {
27 | return (geo && paint) ? sk_sp(new Draw(std::move(geo), std::move(paint))) : nullptr;
28 | }
29 |
30 | protected:
31 | Draw(sk_sp, sk_sp paint);
32 | ~Draw() override;
33 |
34 | void onRender(SkCanvas*, const RenderContext*) const override;
35 | const RenderNode* onNodeAt(const SkPoint&) const override;
36 |
37 | SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
38 |
39 | private:
40 | sk_sp fGeometry;
41 | sk_sp fPaint;
42 |
43 | using INHERITED = RenderNode;
44 | };
45 |
46 | } // namespace sksg
47 |
48 | #endif // SkSGDraw_DEFINED
49 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/sksg/include/SkSGEffectNode.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSGEffectNode_DEFINED
9 | #define SkSGEffectNode_DEFINED
10 |
11 | #include "modules/sksg/include/SkSGRenderNode.h"
12 |
13 | namespace sksg {
14 |
15 | /**
16 | * Base class for nodes which apply some transformation when rendering
17 | * their descendants.
18 | *
19 | * This includes transforms, clipping, filters, etc.
20 | */
21 | class EffectNode : public RenderNode {
22 | protected:
23 | explicit EffectNode(sk_sp, uint32_t inval_traits = 0);
24 | ~EffectNode() override;
25 |
26 | void onRender(SkCanvas*, const RenderContext*) const override;
27 | const RenderNode* onNodeAt(const SkPoint&) const override;
28 |
29 | SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
30 |
31 | const sk_sp& getChild() const { return fChild; }
32 |
33 | private:
34 | sk_sp fChild;
35 |
36 | using INHERITED = RenderNode;
37 | };
38 |
39 | } // namespace sksg
40 |
41 | #endif // SkSGEffectNode_DEFINED
42 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/sksg/include/SkSGGeometryNode.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSGGeometryNode_DEFINED
9 | #define SkSGGeometryNode_DEFINED
10 |
11 | #include "modules/sksg/include/SkSGNode.h"
12 |
13 | class SkCanvas;
14 | class SkPaint;
15 | class SkPath;
16 |
17 | namespace sksg {
18 |
19 | /**
20 | * Base class for nodes which provide 'geometry' (as opposed to paint)
21 | * for drawing.
22 | *
23 | * Think SkRect, SkPath, etc.
24 | */
25 | class GeometryNode : public Node {
26 | public:
27 | void clip(SkCanvas*, bool antiAlias) const;
28 | void draw(SkCanvas*, const SkPaint&) const;
29 |
30 | bool contains(const SkPoint&) const;
31 |
32 | SkPath asPath() const;
33 |
34 | protected:
35 | GeometryNode();
36 |
37 | virtual void onClip(SkCanvas*, bool antiAlias) const = 0;
38 |
39 | virtual void onDraw(SkCanvas*, const SkPaint&) const = 0;
40 |
41 | virtual bool onContains(const SkPoint&) const = 0;
42 |
43 | virtual SkPath onAsPath() const = 0;
44 |
45 | private:
46 | friend class Draw; // wants to know the cached bounds.
47 |
48 | using INHERITED = Node;
49 | };
50 |
51 | } // namespace sksg
52 |
53 | #endif // SkSGGeometryNode_DEFINED
54 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/sksg/include/SkSGImage.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSGImage_DEFINED
9 | #define SkSGImage_DEFINED
10 |
11 | #include "modules/sksg/include/SkSGRenderNode.h"
12 |
13 | #include "include/core/SkSamplingOptions.h"
14 |
15 | class SkImage;
16 |
17 | namespace sksg {
18 |
19 | /**
20 | * Concrete rendering node, wrapping an SkImage.
21 | *
22 | */
23 | class Image final : public RenderNode {
24 | public:
25 | static sk_sp Make(sk_sp image) {
26 | return sk_sp(new Image(std::move(image)));
27 | }
28 |
29 | SG_ATTRIBUTE(Image , sk_sp , fImage )
30 | SG_ATTRIBUTE(SamplingOptions, SkSamplingOptions, fSamplingOptions)
31 | SG_ATTRIBUTE(AntiAlias , bool , fAntiAlias )
32 |
33 | protected:
34 | explicit Image(sk_sp);
35 |
36 | void onRender(SkCanvas*, const RenderContext*) const override;
37 | const RenderNode* onNodeAt(const SkPoint&) const override;
38 |
39 | SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
40 |
41 | private:
42 | SkSamplingOptions fSamplingOptions;
43 | sk_sp fImage;
44 | bool fAntiAlias = true;
45 |
46 | using INHERITED = RenderNode;
47 | };
48 |
49 | } // namespace sksg
50 |
51 | #endif // SkSGImage_DEFINED
52 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/sksg/include/SkSGInvalidationController.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSGInvalidationController_DEFINED
9 | #define SkSGInvalidationController_DEFINED
10 |
11 | #include "include/core/SkMatrix.h"
12 | #include "include/core/SkTypes.h"
13 |
14 | #include
15 |
16 | struct SkRect;
17 |
18 | namespace sksg {
19 |
20 | /**
21 | * Receiver for invalidation events.
22 | *
23 | * Tracks dirty regions for repaint.
24 | */
25 | class InvalidationController {
26 | public:
27 | InvalidationController();
28 | InvalidationController(const InvalidationController&) = delete;
29 | InvalidationController& operator=(const InvalidationController&) = delete;
30 |
31 | void inval(const SkRect&, const SkMatrix& ctm = SkMatrix::I());
32 |
33 | const SkRect& bounds() const { return fBounds; }
34 |
35 | auto begin() const { return fRects.cbegin(); }
36 | auto end() const { return fRects.cend(); }
37 |
38 | void reset();
39 |
40 | private:
41 | std::vector fRects;
42 | SkRect fBounds;
43 | };
44 |
45 | } // namespace sksg
46 |
47 | #endif // SkSGInvalidationController_DEFINED
48 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/sksg/include/SkSGOpacityEffect.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSGOpacityEffect_DEFINED
9 | #define SkSGOpacityEffect_DEFINED
10 |
11 | #include "modules/sksg/include/SkSGEffectNode.h"
12 |
13 | namespace sksg {
14 |
15 | /**
16 | * Concrete Effect node, applying opacity to its descendants.
17 | *
18 | */
19 | class OpacityEffect final : public EffectNode {
20 | public:
21 | static sk_sp Make(sk_sp child, float opacity = 1) {
22 | return child ? sk_sp(new OpacityEffect(std::move(child), opacity)) : nullptr;
23 | }
24 |
25 | SG_ATTRIBUTE(Opacity, float, fOpacity)
26 |
27 | protected:
28 | OpacityEffect(sk_sp, float);
29 |
30 | void onRender(SkCanvas*, const RenderContext*) const override;
31 | const RenderNode* onNodeAt(const SkPoint&) const override;
32 |
33 | SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
34 |
35 | private:
36 | float fOpacity;
37 |
38 | using INHERITED = EffectNode;
39 | };
40 |
41 | } // namespace sksg
42 |
43 | #endif // SkSGOpacityEffect_DEFINED
44 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/sksg/include/SkSGPlane.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSGPlane_DEFINED
9 | #define SkSGPlane_DEFINED
10 |
11 | #include "modules/sksg/include/SkSGGeometryNode.h"
12 |
13 | class SkCanvas;
14 | class SkPaint;
15 |
16 | namespace sksg {
17 |
18 | /**
19 | * Concrete Geometry node, representing the whole canvas.
20 | */
21 | class Plane final : public GeometryNode {
22 | public:
23 | static sk_sp Make() { return sk_sp(new Plane()); }
24 |
25 | protected:
26 | void onClip(SkCanvas*, bool antiAlias) const override;
27 | void onDraw(SkCanvas*, const SkPaint&) const override;
28 | bool onContains(const SkPoint&) const override;
29 |
30 | SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
31 | SkPath onAsPath() const override;
32 |
33 | private:
34 | Plane();
35 |
36 | using INHERITED = GeometryNode;
37 | };
38 |
39 | } // namespace sksg
40 |
41 | #endif // SkSGPlane_DEFINED
42 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/sksg/include/SkSGScene.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSGScene_DEFINED
9 | #define SkSGScene_DEFINED
10 |
11 | #include "include/core/SkRefCnt.h"
12 | #include "include/core/SkTypes.h"
13 |
14 | #include
15 | #include
16 |
17 | class SkCanvas;
18 | struct SkPoint;
19 |
20 | namespace sksg {
21 |
22 | class InvalidationController;
23 | class RenderNode;
24 |
25 | /**
26 | * Holds a scene root. Provides high-level methods for rendering.
27 | *
28 | */
29 | class Scene final {
30 | public:
31 | static std::unique_ptr Make(sk_sp root);
32 | ~Scene();
33 | Scene(const Scene&) = delete;
34 | Scene& operator=(const Scene&) = delete;
35 |
36 | void render(SkCanvas*) const;
37 | void revalidate(InvalidationController* = nullptr);
38 | const RenderNode* nodeAt(const SkPoint&) const;
39 |
40 | private:
41 | explicit Scene(sk_sp root);
42 |
43 | const sk_sp fRoot;
44 | };
45 |
46 | } // namespace sksg
47 |
48 | #endif // SkSGScene_DEFINED
49 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/skunicode/include/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
7 | filegroup(
8 | name = "hdrs",
9 | srcs = [
10 | "SkUnicode.h",
11 | ],
12 | visibility = ["//modules/skunicode:__pkg__"],
13 | )
14 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//bazel:macros.bzl", "exports_files_legacy")
2 |
3 | licenses(["notice"])
4 |
5 | exports_files_legacy()
6 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGCircle.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGCircle_DEFINED
9 | #define SkSVGCircle_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGShape.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | struct SkPoint;
15 |
16 | class SkSVGCircle final : public SkSVGShape {
17 | public:
18 | static sk_sp Make() { return sk_sp(new SkSVGCircle()); }
19 |
20 | SVG_ATTR(Cx, SkSVGLength, SkSVGLength(0))
21 | SVG_ATTR(Cy, SkSVGLength, SkSVGLength(0))
22 | SVG_ATTR(R , SkSVGLength, SkSVGLength(0))
23 |
24 | protected:
25 | bool parseAndSetAttribute(const char*, const char*) override;
26 |
27 | void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
28 | SkPathFillType) const override;
29 |
30 | SkPath onAsPath(const SkSVGRenderContext&) const override;
31 |
32 | SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
33 |
34 | private:
35 | SkSVGCircle();
36 |
37 | // resolve and return the center and radius values
38 | std::tuple resolve(const SkSVGLengthContext&) const;
39 |
40 | using INHERITED = SkSVGShape;
41 | };
42 |
43 | #endif // SkSVGCircle_DEFINED
44 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGClipPath.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGClipPath_DEFINED
9 | #define SkSVGClipPath_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGHiddenContainer.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkSVGClipPath final : public SkSVGHiddenContainer {
15 | public:
16 | static sk_sp Make() {
17 | return sk_sp(new SkSVGClipPath());
18 | }
19 |
20 | SVG_ATTR(ClipPathUnits, SkSVGObjectBoundingBoxUnits,
21 | SkSVGObjectBoundingBoxUnits(SkSVGObjectBoundingBoxUnits::Type::kUserSpaceOnUse))
22 |
23 | private:
24 | friend class SkSVGRenderContext;
25 |
26 | SkSVGClipPath();
27 |
28 | bool parseAndSetAttribute(const char*, const char*) override;
29 |
30 | SkPath resolveClip(const SkSVGRenderContext&) const;
31 |
32 | using INHERITED = SkSVGHiddenContainer;
33 | };
34 |
35 | #endif // SkSVGClipPath_DEFINED
36 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGContainer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGContainer_DEFINED
9 | #define SkSVGContainer_DEFINED
10 |
11 | #include "include/private/SkTArray.h"
12 | #include "modules/svg/include/SkSVGTransformableNode.h"
13 |
14 | class SkSVGContainer : public SkSVGTransformableNode {
15 | public:
16 | void appendChild(sk_sp) override;
17 |
18 | protected:
19 | explicit SkSVGContainer(SkSVGTag);
20 |
21 | void onRender(const SkSVGRenderContext&) const override;
22 |
23 | SkPath onAsPath(const SkSVGRenderContext&) const override;
24 |
25 | SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
26 |
27 | bool hasChildren() const final;
28 |
29 | // TODO: add some sort of child iterator, and hide the container.
30 | SkSTArray<1, sk_sp, true> fChildren;
31 |
32 | private:
33 | using INHERITED = SkSVGTransformableNode;
34 | };
35 |
36 | #endif // SkSVGContainer_DEFINED
37 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGDefs.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGDefs_DEFINED
9 | #define SkSVGDefs_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGHiddenContainer.h"
12 |
13 | class SkSVGDefs : public SkSVGHiddenContainer {
14 | public:
15 | static sk_sp Make() { return sk_sp(new SkSVGDefs()); }
16 |
17 | private:
18 | SkSVGDefs() : INHERITED(SkSVGTag::kDefs) {}
19 |
20 | using INHERITED = SkSVGHiddenContainer;
21 | };
22 |
23 | #endif // SkSVGDefs_DEFINED
24 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGEllipse.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGEllipse_DEFINED
9 | #define SkSVGEllipse_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGShape.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | struct SkRect;
15 |
16 | class SkSVGEllipse final : public SkSVGShape {
17 | public:
18 | static sk_sp Make() { return sk_sp(new SkSVGEllipse()); }
19 |
20 | SVG_ATTR(Cx, SkSVGLength, SkSVGLength(0))
21 | SVG_ATTR(Cy, SkSVGLength, SkSVGLength(0))
22 | SVG_ATTR(Rx, SkSVGLength, SkSVGLength(0))
23 | SVG_ATTR(Ry, SkSVGLength, SkSVGLength(0))
24 |
25 | protected:
26 | bool parseAndSetAttribute(const char*, const char*) override;
27 |
28 | void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
29 | SkPathFillType) const override;
30 |
31 | SkPath onAsPath(const SkSVGRenderContext&) const override;
32 |
33 | private:
34 | SkSVGEllipse();
35 |
36 | SkRect resolve(const SkSVGLengthContext&) const;
37 |
38 | using INHERITED = SkSVGShape;
39 | };
40 |
41 | #endif // SkSVGEllipse_DEFINED
42 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGFeBlend.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGFeBlend_DEFINED
9 | #define SkSVGFeBlend_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGFe.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkSVGFeBlend : public SkSVGFe {
15 | public:
16 | enum class Mode {
17 | kNormal,
18 | kMultiply,
19 | kScreen,
20 | kDarken,
21 | kLighten,
22 | };
23 |
24 | static sk_sp Make() { return sk_sp(new SkSVGFeBlend()); }
25 |
26 | SVG_ATTR(Mode, Mode, Mode::kNormal)
27 | SVG_ATTR(In2, SkSVGFeInputType, SkSVGFeInputType())
28 |
29 | protected:
30 | sk_sp onMakeImageFilter(const SkSVGRenderContext&,
31 | const SkSVGFilterContext&) const override;
32 |
33 | std::vector getInputs() const override {
34 | return {this->getIn(), this->getIn2()};
35 | }
36 |
37 | bool parseAndSetAttribute(const char*, const char*) override;
38 |
39 | private:
40 | SkSVGFeBlend() : INHERITED(SkSVGTag::kFeBlend) {}
41 |
42 | using INHERITED = SkSVGFe;
43 | };
44 |
45 | #endif // SkSVGFeBlend_DEFINED
46 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGFeFlood.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGFeFlood_DEFINED
9 | #define SkSVGFeFlood_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGFe.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkSVGFeFlood : public SkSVGFe {
15 | public:
16 | static sk_sp Make() { return sk_sp(new SkSVGFeFlood()); }
17 |
18 | protected:
19 | sk_sp onMakeImageFilter(const SkSVGRenderContext&,
20 | const SkSVGFilterContext&) const override;
21 |
22 | std::vector getInputs() const override { return {}; }
23 |
24 | private:
25 | SkSVGFeFlood() : INHERITED(SkSVGTag::kFeFlood) {}
26 |
27 | SkColor resolveFloodColor(const SkSVGRenderContext&) const;
28 |
29 | using INHERITED = SkSVGFe;
30 | };
31 |
32 | #endif // SkSVGFeFlood_DEFINED
33 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGFeGaussianBlur.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGFeGaussianBlur_DEFINED
9 | #define SkSVGFeGaussianBlur_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGFe.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkSVGFeGaussianBlur : public SkSVGFe {
15 | public:
16 | struct StdDeviation {
17 | SkSVGNumberType fX;
18 | SkSVGNumberType fY;
19 | };
20 |
21 | static sk_sp Make() {
22 | return sk_sp(new SkSVGFeGaussianBlur());
23 | }
24 |
25 | SVG_ATTR(StdDeviation, StdDeviation, StdDeviation({0, 0}))
26 |
27 | protected:
28 | sk_sp onMakeImageFilter(const SkSVGRenderContext&,
29 | const SkSVGFilterContext&) const override;
30 |
31 | std::vector getInputs() const override { return {this->getIn()}; }
32 |
33 | bool parseAndSetAttribute(const char*, const char*) override;
34 |
35 | private:
36 | SkSVGFeGaussianBlur() : INHERITED(SkSVGTag::kFeGaussianBlur) {}
37 |
38 | using INHERITED = SkSVGFe;
39 | };
40 |
41 | #endif // SkSVGFeGaussianBlur_DEFINED
42 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGFeImage.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGFeImage_DEFINED
9 | #define SkSVGFeImage_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGFe.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkSVGFeImage : public SkSVGFe {
15 | public:
16 | static sk_sp Make() { return sk_sp(new SkSVGFeImage()); }
17 |
18 | SVG_ATTR(Href , SkSVGIRI , SkSVGIRI())
19 | SVG_ATTR(PreserveAspectRatio, SkSVGPreserveAspectRatio, SkSVGPreserveAspectRatio())
20 |
21 | protected:
22 | bool parseAndSetAttribute(const char*, const char*) override;
23 |
24 | sk_sp onMakeImageFilter(const SkSVGRenderContext&,
25 | const SkSVGFilterContext&) const override;
26 |
27 | std::vector getInputs() const override { return {}; }
28 |
29 | private:
30 | SkSVGFeImage() : INHERITED(SkSVGTag::kFeImage) {}
31 |
32 | using INHERITED = SkSVGFe;
33 | };
34 |
35 | #endif // SkSVGFeImage_DEFINED
36 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGFeMorphology.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGFeMorphology_DEFINED
9 | #define SkSVGFeMorphology_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGFe.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkSVGFeMorphology : public SkSVGFe {
15 | public:
16 | struct Radius {
17 | SkSVGNumberType fX;
18 | SkSVGNumberType fY;
19 | };
20 |
21 | enum class Operator {
22 | kErode,
23 | kDilate,
24 | };
25 |
26 | static sk_sp Make() {
27 | return sk_sp(new SkSVGFeMorphology());
28 | }
29 |
30 | SVG_ATTR(Operator, Operator, Operator::kErode)
31 | SVG_ATTR(Radius , Radius , Radius({0, 0}))
32 |
33 | protected:
34 | sk_sp onMakeImageFilter(const SkSVGRenderContext&,
35 | const SkSVGFilterContext&) const override;
36 |
37 | std::vector getInputs() const override { return {this->getIn()}; }
38 |
39 | bool parseAndSetAttribute(const char*, const char*) override;
40 |
41 | private:
42 | SkSVGFeMorphology() : INHERITED(SkSVGTag::kFeMorphology) {}
43 |
44 | using INHERITED = SkSVGFe;
45 | };
46 |
47 | #endif // SkSVGFeMorphology_DEFINED
48 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGFeOffset.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGFeOffset_DEFINED
9 | #define SkSVGFeOffset_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGFe.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkSVGFeOffset : public SkSVGFe {
15 | public:
16 | static sk_sp Make() { return sk_sp(new SkSVGFeOffset()); }
17 |
18 | SVG_ATTR(Dx, SkSVGNumberType, SkSVGNumberType(0))
19 | SVG_ATTR(Dy, SkSVGNumberType, SkSVGNumberType(0))
20 |
21 | protected:
22 | sk_sp onMakeImageFilter(const SkSVGRenderContext&,
23 | const SkSVGFilterContext&) const override;
24 |
25 | std::vector getInputs() const override { return {this->getIn()}; }
26 |
27 | bool parseAndSetAttribute(const char*, const char*) override;
28 |
29 | private:
30 | SkSVGFeOffset() : INHERITED(SkSVGTag::kFeOffset) {}
31 |
32 | using INHERITED = SkSVGFe;
33 | };
34 |
35 | #endif // SkSVGFeOffset_DEFINED
36 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGFeTurbulence.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGFeTurbulence_DEFINED
9 | #define SkSVGFeTurbulence_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGFe.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkSVGFeTurbulence : public SkSVGFe {
15 | public:
16 | static sk_sp Make() {
17 | return sk_sp(new SkSVGFeTurbulence());
18 | }
19 |
20 | SVG_ATTR(BaseFrequency, SkSVGFeTurbulenceBaseFrequency, SkSVGFeTurbulenceBaseFrequency({}))
21 | SVG_ATTR(NumOctaves, SkSVGIntegerType, SkSVGIntegerType(1))
22 | SVG_ATTR(Seed, SkSVGNumberType, SkSVGNumberType(0))
23 | SVG_ATTR(TurbulenceType,
24 | SkSVGFeTurbulenceType,
25 | SkSVGFeTurbulenceType(SkSVGFeTurbulenceType::Type::kTurbulence))
26 |
27 | protected:
28 | sk_sp onMakeImageFilter(const SkSVGRenderContext&,
29 | const SkSVGFilterContext&) const override;
30 |
31 | std::vector getInputs() const override { return {}; }
32 |
33 | bool parseAndSetAttribute(const char*, const char*) override;
34 | private:
35 | SkSVGFeTurbulence() : INHERITED(SkSVGTag::kFeTurbulence) {}
36 |
37 | using INHERITED = SkSVGFe;
38 | };
39 |
40 | #endif // SkSVGFeTurbulence_DEFINED
41 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGG.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGG_DEFINED
9 | #define SkSVGG_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGContainer.h"
12 |
13 | class SkSVGG : public SkSVGContainer {
14 | public:
15 | static sk_sp Make() { return sk_sp(new SkSVGG()); }
16 |
17 | private:
18 | SkSVGG() : INHERITED(SkSVGTag::kG) { }
19 |
20 | using INHERITED = SkSVGContainer;
21 | };
22 |
23 | #endif // SkSVGG_DEFINED
24 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGHiddenContainer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGHiddenContainer_DEFINED
9 | #define SkSVGHiddenContainer_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGContainer.h"
12 |
13 | class SkSVGHiddenContainer : public SkSVGContainer {
14 | protected:
15 | explicit SkSVGHiddenContainer(SkSVGTag t) : INHERITED(t) {}
16 |
17 | void onRender(const SkSVGRenderContext&) const final {}
18 |
19 | private:
20 | using INHERITED = SkSVGContainer;
21 | };
22 |
23 | #endif // SkSVGHiddenContainer_DEFINED
24 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGIDMapper.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGIDMapper_DEFINED
9 | #define SkSVGIDMapper_DEFINED
10 |
11 | #include "include/core/SkRefCnt.h"
12 | #include "include/private/SkTHash.h"
13 |
14 | class SkString;
15 | class SkSVGNode;
16 |
17 | using SkSVGIDMapper = SkTHashMap>;
18 |
19 | #endif // SkSVGIDMapper_DEFINED
20 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGLine.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGLine_DEFINED
9 | #define SkSVGLine_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGShape.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | struct SkPoint;
15 |
16 | class SkSVGLine final : public SkSVGShape {
17 | public:
18 | static sk_sp Make() { return sk_sp(new SkSVGLine()); }
19 |
20 | SVG_ATTR(X1, SkSVGLength, SkSVGLength(0))
21 | SVG_ATTR(Y1, SkSVGLength, SkSVGLength(0))
22 | SVG_ATTR(X2, SkSVGLength, SkSVGLength(0))
23 | SVG_ATTR(Y2, SkSVGLength, SkSVGLength(0))
24 |
25 | protected:
26 | bool parseAndSetAttribute(const char*, const char*) override;
27 |
28 | void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
29 | SkPathFillType) const override;
30 |
31 | SkPath onAsPath(const SkSVGRenderContext&) const override;
32 |
33 | private:
34 | SkSVGLine();
35 |
36 | // resolve and return the two endpoints
37 | std::tuple resolve(const SkSVGLengthContext&) const;
38 |
39 | using INHERITED = SkSVGShape;
40 | };
41 |
42 | #endif // SkSVGLine_DEFINED
43 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGLinearGradient.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGLinearGradient_DEFINED
9 | #define SkSVGLinearGradient_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGGradient.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkSVGLinearGradient final : public SkSVGGradient {
15 | public:
16 | static sk_sp Make() {
17 | return sk_sp(new SkSVGLinearGradient());
18 | }
19 |
20 | SVG_ATTR(X1, SkSVGLength, SkSVGLength(0 , SkSVGLength::Unit::kPercentage))
21 | SVG_ATTR(Y1, SkSVGLength, SkSVGLength(0 , SkSVGLength::Unit::kPercentage))
22 | SVG_ATTR(X2, SkSVGLength, SkSVGLength(100, SkSVGLength::Unit::kPercentage))
23 | SVG_ATTR(Y2, SkSVGLength, SkSVGLength(0 , SkSVGLength::Unit::kPercentage))
24 |
25 | protected:
26 | bool parseAndSetAttribute(const char*, const char*) override;
27 |
28 | sk_sp onMakeShader(const SkSVGRenderContext&,
29 | const SkColor4f*, const SkScalar*, int count,
30 | SkTileMode, const SkMatrix&) const override;
31 | private:
32 | SkSVGLinearGradient();
33 |
34 | using INHERITED = SkSVGGradient;
35 | };
36 |
37 | #endif // SkSVGLinearGradient_DEFINED
38 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGOpenTypeSVGDecoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGOpenTypeSVGDecoder_DEFINED
9 | #define SkSVGOpenTypeSVGDecoder_DEFINED
10 |
11 | #include "include/core/SkColor.h"
12 | #include "include/core/SkOpenTypeSVGDecoder.h"
13 | #include "include/core/SkSpan.h"
14 | #include "include/core/SkTypes.h"
15 |
16 | class SkCanvas;
17 | class SkSVGDOM;
18 |
19 | class SkSVGOpenTypeSVGDecoder : public SkOpenTypeSVGDecoder {
20 | public:
21 | static std::unique_ptr Make(const uint8_t* svg, size_t svgLength);
22 | size_t approximateSize() override;
23 | bool render(SkCanvas&, int upem, SkGlyphID glyphId,
24 | SkColor foregroundColor, SkSpan palette) override;
25 | ~SkSVGOpenTypeSVGDecoder() override;
26 | private:
27 | SkSVGOpenTypeSVGDecoder(sk_sp skSvg, size_t approximateSize);
28 | sk_sp fSkSvg;
29 | size_t fApproximateSize;
30 | };
31 |
32 | #endif // SkSVGOpenTypeSVGDecoder_DEFINED
33 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGPath.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGPath_DEFINED
9 | #define SkSVGPath_DEFINED
10 |
11 | #include "include/core/SkPath.h"
12 | #include "modules/svg/include/SkSVGShape.h"
13 |
14 | class SkSVGPath final : public SkSVGShape {
15 | public:
16 | static sk_sp Make() { return sk_sp(new SkSVGPath()); }
17 |
18 | SVG_ATTR(Path, SkPath, SkPath())
19 |
20 | protected:
21 | bool parseAndSetAttribute(const char*, const char*) override;
22 |
23 | void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
24 | SkPathFillType) const override;
25 |
26 | SkPath onAsPath(const SkSVGRenderContext&) const override;
27 |
28 | SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
29 |
30 | private:
31 | SkSVGPath();
32 |
33 | using INHERITED = SkSVGShape;
34 | };
35 |
36 | #endif // SkSVGPath_DEFINED
37 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGPoly.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGPoly_DEFINED
9 | #define SkSVGPoly_DEFINED
10 |
11 | #include "include/core/SkPath.h"
12 | #include "modules/svg/include/SkSVGShape.h"
13 |
14 | // Handles and elements.
15 | class SkSVGPoly final : public SkSVGShape {
16 | public:
17 | static sk_sp MakePolygon() {
18 | return sk_sp(new SkSVGPoly(SkSVGTag::kPolygon));
19 | }
20 |
21 | static sk_sp MakePolyline() {
22 | return sk_sp(new SkSVGPoly(SkSVGTag::kPolyline));
23 | }
24 |
25 | SVG_ATTR(Points, SkSVGPointsType, SkSVGPointsType())
26 |
27 | protected:
28 | bool parseAndSetAttribute(const char*, const char*) override;
29 |
30 | void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
31 | SkPathFillType) const override;
32 |
33 | SkPath onAsPath(const SkSVGRenderContext&) const override;
34 |
35 | SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
36 |
37 | private:
38 | SkSVGPoly(SkSVGTag);
39 |
40 | mutable SkPath fPath; // mutated in onDraw(), to apply inherited fill types.
41 |
42 | using INHERITED = SkSVGShape;
43 | };
44 |
45 | #endif // SkSVGPoly_DEFINED
46 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGRadialGradient.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGRadialGradient_DEFINED
9 | #define SkSVGRadialGradient_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGGradient.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkSVGRadialGradient final : public SkSVGGradient {
15 | public:
16 | static sk_sp Make() {
17 | return sk_sp(new SkSVGRadialGradient());
18 | }
19 |
20 | SVG_ATTR(Cx, SkSVGLength, SkSVGLength(50, SkSVGLength::Unit::kPercentage))
21 | SVG_ATTR(Cy, SkSVGLength, SkSVGLength(50, SkSVGLength::Unit::kPercentage))
22 | SVG_ATTR(R, SkSVGLength, SkSVGLength(50, SkSVGLength::Unit::kPercentage))
23 | SVG_OPTIONAL_ATTR(Fx, SkSVGLength)
24 | SVG_OPTIONAL_ATTR(Fy, SkSVGLength)
25 |
26 | protected:
27 | bool parseAndSetAttribute(const char*, const char*) override;
28 |
29 | sk_sp onMakeShader(const SkSVGRenderContext&,
30 | const SkColor4f*, const SkScalar*, int count,
31 | SkTileMode, const SkMatrix&) const override;
32 | private:
33 | SkSVGRadialGradient();
34 |
35 | using INHERITED = SkSVGGradient;
36 | };
37 |
38 | #endif // SkSVGRadialGradient_DEFINED
39 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGRect.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGRect_DEFINED
9 | #define SkSVGRect_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGShape.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkRRect;
15 |
16 | class SkSVGRect final : public SkSVGShape {
17 | public:
18 | static sk_sp Make() { return sk_sp(new SkSVGRect()); }
19 |
20 | SVG_ATTR(X , SkSVGLength, SkSVGLength(0))
21 | SVG_ATTR(Y , SkSVGLength, SkSVGLength(0))
22 | SVG_ATTR(Width , SkSVGLength, SkSVGLength(0))
23 | SVG_ATTR(Height, SkSVGLength, SkSVGLength(0))
24 |
25 | SVG_OPTIONAL_ATTR(Rx, SkSVGLength)
26 | SVG_OPTIONAL_ATTR(Ry, SkSVGLength)
27 |
28 | protected:
29 | bool parseAndSetAttribute(const char*, const char*) override;
30 |
31 | void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
32 | SkPathFillType) const override;
33 |
34 | SkPath onAsPath(const SkSVGRenderContext&) const override;
35 |
36 | SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
37 |
38 | private:
39 | SkSVGRect();
40 |
41 | SkRRect resolve(const SkSVGLengthContext&) const;
42 |
43 | using INHERITED = SkSVGShape;
44 | };
45 |
46 | #endif // SkSVGRect_DEFINED
47 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGShape.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGShape_DEFINED
9 | #define SkSVGShape_DEFINED
10 |
11 | #include "include/core/SkPath.h"
12 | #include "modules/svg/include/SkSVGTransformableNode.h"
13 |
14 | class SkSVGLengthContext;
15 | class SkPaint;
16 |
17 | class SkSVGShape : public SkSVGTransformableNode {
18 | public:
19 | void appendChild(sk_sp) override;
20 |
21 | protected:
22 | SkSVGShape(SkSVGTag);
23 |
24 | void onRender(const SkSVGRenderContext&) const final;
25 |
26 | virtual void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
27 | SkPathFillType) const = 0;
28 |
29 | private:
30 | using INHERITED = SkSVGTransformableNode;
31 | };
32 |
33 | #endif // SkSVGShape_DEFINED
34 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/skia/modules/svg/include/SkSVGStop.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Google Inc.
3 | *
4 | * Use of this source code is governed by a BSD-style license that can be
5 | * found in the LICENSE file.
6 | */
7 |
8 | #ifndef SkSVGStop_DEFINED
9 | #define SkSVGStop_DEFINED
10 |
11 | #include "modules/svg/include/SkSVGHiddenContainer.h"
12 | #include "modules/svg/include/SkSVGTypes.h"
13 |
14 | class SkSVGLengthContext;
15 |
16 | class SkSVGStop : public SkSVGHiddenContainer {
17 | public:
18 | static sk_sp