10#if defined(SK_BUILD_FOR_ANDROID) && __ANDROID_API__ >= 26
25#if defined(SK_GRAPHITE)
45 AHardwareBuffer_release(
buffer);
62#if defined(SK_GRAPHITE)
90#if defined(SK_GRAPHITE)
107 AHardwareBuffer_Desc hwbDesc;
108 hwbDesc.width =
width;
111 hwbDesc.usage = AHARDWAREBUFFER_USAGE_CPU_READ_NEVER |
112 AHARDWAREBUFFER_USAGE_CPU_WRITE_NEVER |
113 AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE |
114 AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT;
116 hwbDesc.usage |= AHARDWAREBUFFER_USAGE_PROTECTED_CONTENT;
118 hwbDesc.format = AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM;
124 if (
int error = AHardwareBuffer_allocate(&hwbDesc, &
buffer)) {
125 SkDebugf(
"Failed to allocated hardware buffer, error: %d\n",
error);
140 SkDebugf(
"Failed to make SkSurface.\n");
156 sk_sp<SkSurface> tmpSurface = create_protected_render_target(dContext, recorder, ii);
168class ProtectedSlide :
public Slide {
170 ProtectedSlide() {
fName =
"Protected"; }
180#if defined(SK_GANESH)
187#if defined(SK_GRAPHITE)
194 if (!dContext && !recorder) {
203 sk_sp<SkImage> protectedSkImage = create_protected_skia_image(dContext, recorder,
216 sk_sp<SkSurface> tmpS = create_protected_render_target(dContext, recorder, ii);
229 protectedAHBImage.
reset();
230 protectedSkImage.
reset();
235 static const int kSize = 128;
struct AHardwareBuffer AHardwareBuffer
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kTopLeft_GrSurfaceOrigin
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorDKGRAY
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
SK_API bool supportsProtectedContent() const
virtual GrRecordingContext * recordingContext() const
virtual skgpu::graphite::Recorder * recorder() const
void clear(SkColor color)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
sk_sp< SkImage > makeImageSnapshot()
virtual SkISize getDimensions() const
virtual void draw(SkCanvas *canvas)=0
void reset(T *ptr=nullptr)
Protected isProtected() const
const uint8_t uint32_t uint32_t GError ** error
SK_API sk_sp< SkSurface > WrapAndroidHardwareBuffer(skgpu::graphite::Recorder *recorder, AHardwareBuffer *hardwareBuffer, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, BufferReleaseProc=nullptr, ReleaseContext=nullptr, bool fromWindow=false)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)