Skia
2D Graphics Library
SkSurface.h
Go to the documentation of this file.
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 SkSurface_DEFINED
9 #define SkSurface_DEFINED
10 
11 #include "include/core/SkImage.h"
12 #include "include/core/SkPixmap.h"
13 #include "include/core/SkRefCnt.h"
15 
16 #include "include/gpu/GrTypes.h"
17 
18 #if defined(SK_BUILD_FOR_ANDROID) && __ANDROID_API__ >= 26
19 #include <android/hardware_buffer.h>
20 #endif
21 
22 #ifdef SK_METAL
23 #include "include/gpu/mtl/GrMtlTypes.h"
24 #endif
25 
26 class SkCanvas;
28 class SkPaint;
31 class GrBackendSemaphore;
33 class GrBackendTexture;
34 class GrDirectContext;
35 class GrRecordingContext;
36 class GrRenderTarget;
37 
46 class SK_API SkSurface : public SkRefCnt {
47 public:
48 
70  static sk_sp<SkSurface> MakeRasterDirect(const SkImageInfo& imageInfo, void* pixels,
71  size_t rowBytes,
72  const SkSurfaceProps* surfaceProps = nullptr);
73 
75  const SkSurfaceProps* props = nullptr) {
76  return MakeRasterDirect(pm.info(), pm.writable_addr(), pm.rowBytes(), props);
77  }
78 
103  static sk_sp<SkSurface> MakeRasterDirectReleaseProc(const SkImageInfo& imageInfo, void* pixels,
104  size_t rowBytes,
105  void (*releaseProc)(void* pixels, void* context),
106  void* context, const SkSurfaceProps* surfaceProps = nullptr);
107 
128  static sk_sp<SkSurface> MakeRaster(const SkImageInfo& imageInfo, size_t rowBytes,
129  const SkSurfaceProps* surfaceProps);
130 
147  static sk_sp<SkSurface> MakeRaster(const SkImageInfo& imageInfo,
148  const SkSurfaceProps* props = nullptr) {
149  return MakeRaster(imageInfo, 0, props);
150  }
151 
170  static sk_sp<SkSurface> MakeRasterN32Premul(int width, int height,
171  const SkSurfaceProps* surfaceProps = nullptr);
172 
174  typedef void* ReleaseContext;
175 
177  typedef void (*RenderTargetReleaseProc)(ReleaseContext releaseContext);
178 
180  typedef void (*TextureReleaseProc)(ReleaseContext releaseContext);
181 
210  const GrBackendTexture& backendTexture,
211  GrSurfaceOrigin origin, int sampleCnt,
212  SkColorType colorType,
213  sk_sp<SkColorSpace> colorSpace,
214  const SkSurfaceProps* surfaceProps,
215  TextureReleaseProc textureReleaseProc = nullptr,
216  ReleaseContext releaseContext = nullptr);
217 
244  const GrBackendRenderTarget& backendRenderTarget,
245  GrSurfaceOrigin origin,
246  SkColorType colorType,
247  sk_sp<SkColorSpace> colorSpace,
248  const SkSurfaceProps* surfaceProps,
249  RenderTargetReleaseProc releaseProc = nullptr,
250  ReleaseContext releaseContext = nullptr);
251 
252 #if defined(SK_BUILD_FOR_ANDROID) && __ANDROID_API__ >= 26
253 
272  static sk_sp<SkSurface> MakeFromAHardwareBuffer(GrDirectContext* context,
273  AHardwareBuffer* hardwareBuffer,
274  GrSurfaceOrigin origin,
275  sk_sp<SkColorSpace> colorSpace,
276  const SkSurfaceProps* surfaceProps);
277 #endif
278 
279 #ifdef SK_METAL
280 
299  static sk_sp<SkSurface> MakeFromCAMetalLayer(GrRecordingContext* context,
300  GrMTLHandle layer,
301  GrSurfaceOrigin origin,
302  int sampleCnt,
303  SkColorType colorType,
304  sk_sp<SkColorSpace> colorSpace,
305  const SkSurfaceProps* surfaceProps,
306  GrMTLHandle* drawable)
307  SK_API_AVAILABLE_CA_METAL_LAYER;
308 
326  static sk_sp<SkSurface> MakeFromMTKView(GrRecordingContext* context,
327  GrMTLHandle mtkView,
328  GrSurfaceOrigin origin,
329  int sampleCnt,
330  SkColorType colorType,
331  sk_sp<SkColorSpace> colorSpace,
332  const SkSurfaceProps* surfaceProps)
333  SK_API_AVAILABLE(macos(10.11), ios(9.0));
334 #endif
335 
363  const SkImageInfo& imageInfo,
364  int sampleCount, GrSurfaceOrigin surfaceOrigin,
365  const SkSurfaceProps* surfaceProps,
366  bool shouldCreateWithMips = false);
367 
390  const SkImageInfo& imageInfo, int sampleCount,
391  const SkSurfaceProps* surfaceProps) {
392  return MakeRenderTarget(context, budgeted, imageInfo, sampleCount,
393  kBottomLeft_GrSurfaceOrigin, surfaceProps);
394  }
395 
410  const SkImageInfo& imageInfo) {
411  if (!imageInfo.width() || !imageInfo.height()) {
412  return nullptr;
413  }
414  return MakeRenderTarget(context, budgeted, imageInfo, 0, kBottomLeft_GrSurfaceOrigin,
415  nullptr);
416  }
417 
426  const SkSurfaceCharacterization& characterization,
427  SkBudgeted budgeted);
428 
438  bool isCompatible(const SkSurfaceCharacterization& characterization) const;
439 
449  static sk_sp<SkSurface> MakeNull(int width, int height);
450 
455  int width() const { return fWidth; }
456 
461  int height() const { return fHeight; }
462 
466 
475  uint32_t generationID();
476 
483  };
484 
493 
499 
504  };
505 
508  static const BackendHandleAccess kFlushRead_TextureHandleAccess =
509  kFlushRead_BackendHandleAccess;
510 
513  static const BackendHandleAccess kFlushWrite_TextureHandleAccess =
514  kFlushWrite_BackendHandleAccess;
515 
518  static const BackendHandleAccess kDiscardWrite_TextureHandleAccess =
519  kDiscardWrite_BackendHandleAccess;
520 
530 
541 
557  bool replaceBackendTexture(const GrBackendTexture& backendTexture,
558  GrSurfaceOrigin origin,
559  ContentChangeMode mode = kRetain_ContentChangeMode,
560  TextureReleaseProc textureReleaseProc = nullptr,
561  ReleaseContext releaseContext = nullptr);
562 
572 
587 
591  sk_sp<SkSurface> makeSurface(int width, int height);
592 
602 
615 
629  void draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkSamplingOptions& sampling,
630  const SkPaint* paint);
631  void draw(SkCanvas* canvas, SkScalar x, SkScalar y) {
632  this->draw(canvas, x, y, SkSamplingOptions(), nullptr);
633  }
634 
635  // DEPRECATED -- use explicit sampling options
636  void draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint);
637 
649  bool peekPixels(SkPixmap* pixmap);
650 
680  bool readPixels(const SkPixmap& dst, int srcX, int srcY);
681 
711  bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
712  int srcX, int srcY);
713 
744  bool readPixels(const SkBitmap& dst, int srcX, int srcY);
745 
747 
749  using ReadPixelsContext = void*;
750 
754  using ReadPixelsCallback = void(ReadPixelsContext, std::unique_ptr<const AsyncReadResult>);
755 
761 
793  const SkIRect& srcRect,
794  RescaleGamma rescaleGamma,
795  RescaleMode rescaleMode,
796  ReadPixelsCallback callback,
797  ReadPixelsContext context);
798 
829  sk_sp<SkColorSpace> dstColorSpace,
830  const SkIRect& srcRect,
831  const SkISize& dstSize,
832  RescaleGamma rescaleGamma,
833  RescaleMode rescaleMode,
834  ReadPixelsCallback callback,
835  ReadPixelsContext context);
836 
852  void writePixels(const SkPixmap& src, int dstX, int dstY);
853 
869  void writePixels(const SkBitmap& src, int dstX, int dstY);
870 
875  const SkSurfaceProps& props() const { return fProps; }
876 
885  void flushAndSubmit(bool syncCpu = false);
886 
887  enum class BackendSurfaceAccess {
888  kNoAccess,
889  kPresent,
890  };
891 
937 
983  const GrBackendSurfaceMutableState* newState = nullptr);
984 
985  void flush() { this->flush({}); }
986 
1002  bool wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores,
1003  bool deleteSemaphoresAfterWait = true);
1004 
1017  bool characterize(SkSurfaceCharacterization* characterization) const;
1018 
1035  bool draw(sk_sp<const SkDeferredDisplayList> deferredDisplayList,
1036  int xOffset = 0,
1037  int yOffset = 0);
1038 
1039 protected:
1040  SkSurface(int width, int height, const SkSurfaceProps* surfaceProps);
1041  SkSurface(const SkImageInfo& imageInfo, const SkSurfaceProps* surfaceProps);
1042 
1043  // called by subclass if their contents have changed
1045  fGenerationID = 0;
1046  }
1047 
1048 private:
1049  const SkSurfaceProps fProps;
1050  const int fWidth;
1051  const int fHeight;
1052  uint32_t fGenerationID;
1053 
1054  using INHERITED = SkRefCnt;
1055 };
1056 
1057 #endif
GrRecordingContext
Definition: GrRecordingContext.h:34
SkSurface::kRetain_ContentChangeMode
@ kRetain_ContentChangeMode
preserves surface on change
Definition: SkSurface.h:482
SkSurface::asyncRescaleAndReadPixelsYUV420
void asyncRescaleAndReadPixelsYUV420(SkYUVColorSpace yuvColorSpace, sk_sp< SkColorSpace > dstColorSpace, const SkIRect &srcRect, const SkISize &dstSize, RescaleGamma rescaleGamma, RescaleMode rescaleMode, ReadPixelsCallback callback, ReadPixelsContext context)
Similar to asyncRescaleAndReadPixels but performs an additional conversion to YUV.
SkSurface::height
int height() const
Returns pixel row count; may be zero or greater.
Definition: SkSurface.h:461
SkSurface::flushAndSubmit
void flushAndSubmit(bool syncCpu=false)
Call to ensure all reads/writes of the surface have been issued to the underlying 3D API.
SkImageInfo::height
int height() const
Returns pixel row count.
Definition: SkImageInfo.h:458
GrSemaphoresSubmitted
GrSemaphoresSubmitted
Enum used as return value when flush with semaphores so the client knows whether the valid semaphores...
Definition: GrTypes.h:284
SkRefCnt
Definition: SkRefCnt.h:118
SkSurface::props
const SkSurfaceProps & props() const
Returns SkSurfaceProps for surface.
Definition: SkSurface.h:875
SkSurface::MakeFromBackendRenderTarget
static sk_sp< SkSurface > MakeFromBackendRenderTarget(GrRecordingContext *context, const GrBackendRenderTarget &backendRenderTarget, GrSurfaceOrigin origin, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, RenderTargetReleaseProc releaseProc=nullptr, ReleaseContext releaseContext=nullptr)
Wraps a GPU-backed buffer into SkSurface.
SkSurface::kFlushWrite_BackendHandleAccess
@ kFlushWrite_BackendHandleAccess
back-end object is writable
Definition: SkSurface.h:502
SkSurface::asyncRescaleAndReadPixels
void asyncRescaleAndReadPixels(const SkImageInfo &info, const SkIRect &srcRect, RescaleGamma rescaleGamma, RescaleMode rescaleMode, ReadPixelsCallback callback, ReadPixelsContext context)
Makes surface pixel data available to caller, possibly asynchronously.
SkSurface
Definition: SkSurface.h:46
SkYUVColorSpace
SkYUVColorSpace
Definition: SkImageInfo.h:148
GrSurfaceOrigin
GrSurfaceOrigin
GPU SkImage and SkSurfaces can be stored such that (0, 0) in texture space may correspond to either t...
Definition: GrTypes.h:198
SkSurface::MakeFromBackendTexture
static sk_sp< SkSurface > MakeFromBackendTexture(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, int sampleCnt, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
Wraps a GPU-backed texture into SkSurface.
SkPixmap::writable_addr
void * writable_addr() const
Returns writable base pixel address.
Definition: SkPixmap.h:455
SkSurface::imageInfo
SkImageInfo imageInfo()
Returns an ImageInfo describing the surface.
SkSurface::MakeRaster
static sk_sp< SkSurface > MakeRaster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
Allocates raster SkSurface.
SkSurface::kDiscard_ContentChangeMode
@ kDiscard_ContentChangeMode
discards surface on change
Definition: SkSurface.h:481
SkSurface::draw
void draw(SkCanvas *canvas, SkScalar x, SkScalar y, const SkSamplingOptions &sampling, const SkPaint *paint)
Draws SkSurface contents to canvas, with its top-left corner at (x, y).
SkSurface::peekPixels
bool peekPixels(SkPixmap *pixmap)
Copies SkSurface pixel address, row bytes, and SkImageInfo to SkPixmap, if address is available,...
SkSurface::draw
void draw(SkCanvas *canvas, SkScalar x, SkScalar y)
Definition: SkSurface.h:631
SkSurface::ReadPixelsCallback
void(ReadPixelsContext, std::unique_ptr< const AsyncReadResult >) ReadPixelsCallback
Client-provided callback to asyncRescaleAndReadPixels() or asyncRescaleAndReadPixelsYUV420() that is ...
Definition: SkSurface.h:754
SkSurface::SkSurface
SkSurface(const SkImageInfo &imageInfo, const SkSurfaceProps *surfaceProps)
SkSurface::notifyContentWillChange
void notifyContentWillChange(ContentChangeMode mode)
Notifies that SkSurface contents will be changed by code outside of Skia.
SkSurface::SkSurface
SkSurface(int width, int height, const SkSurfaceProps *surfaceProps)
SkImage::RescaleMode
RescaleMode
Definition: SkImage.h:832
SkPixmap.h
GrBackendRenderTarget
Definition: GrBackendSurface.h:61
SkSurface::MakeRasterN32Premul
static sk_sp< SkSurface > MakeRasterN32Premul(int width, int height, const SkSurfaceProps *surfaceProps=nullptr)
Allocates raster SkSurface.
SkSurface::BackendHandleAccess
BackendHandleAccess
Definition: SkSurface.h:500
SkSurface::getCanvas
SkCanvas * getCanvas()
Returns SkCanvas that draws into SkSurface.
SkSurface::flush
void flush()
Definition: SkSurface.h:985
SkRefCnt.h
SkSurface::makeImageSnapshot
sk_sp< SkImage > makeImageSnapshot(const SkIRect &bounds)
Like the no-parameter version, this returns an image of the current surface contents.
SkSurface::kDiscardWrite_BackendHandleAccess
@ kDiscardWrite_BackendHandleAccess
back-end object must be overwritten
Definition: SkSurface.h:503
SkSurface::flush
GrSemaphoresSubmitted flush(BackendSurfaceAccess access, const GrFlushInfo &info)
Issues pending SkSurface commands to the GPU-backed API objects and resolves any SkSurface MSAA.
SkSurface::MakeRenderTarget
static sk_sp< SkSurface > MakeRenderTarget(GrRecordingContext *context, const SkSurfaceCharacterization &characterization, SkBudgeted budgeted)
Returns SkSurface on GPU indicated by context that is compatible with the provided characterization.
SkSurface::MakeRasterDirect
static sk_sp< SkSurface > MakeRasterDirect(const SkImageInfo &imageInfo, void *pixels, size_t rowBytes, const SkSurfaceProps *surfaceProps=nullptr)
Allocates raster SkSurface.
sk_sp
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:215
SkSamplingOptions
Definition: SkSamplingOptions.h:50
SkPixmap::rowBytes
size_t rowBytes() const
Returns row bytes, the interval from one pixel row to the next.
Definition: SkPixmap.h:136
SkSurface::ReleaseContext
void * ReleaseContext
Caller data passed to RenderTarget/TextureReleaseProc; may be nullptr.
Definition: SkSurface.h:174
GrFlushInfo
Struct to supply options to flush calls.
Definition: GrTypes.h:271
SkSurface::getBackendRenderTarget
GrBackendRenderTarget getBackendRenderTarget(BackendHandleAccess backendHandleAccess)
Retrieves the back-end render target.
SkSurface::makeSurface
sk_sp< SkSurface > makeSurface(const SkImageInfo &imageInfo)
Returns a compatible SkSurface, or nullptr.
SkPaint
Definition: SkPaint.h:39
SK_API
#define SK_API
Definition: SkTypes.h:181
SkSurface::flush
GrSemaphoresSubmitted flush(const GrFlushInfo &info, const GrBackendSurfaceMutableState *newState=nullptr)
Issues pending SkSurface commands to the GPU-backed API objects and resolves any SkSurface MSAA.
SkSurfaceProps
Describes properties and constraints of a given SkSurface.
Definition: SkSurfaceProps.h:51
SkSurface::MakeRenderTarget
static sk_sp< SkSurface > MakeRenderTarget(GrRecordingContext *context, SkBudgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false)
Returns SkSurface on GPU indicated by context.
GrBackendSemaphore
Wrapper class for passing into and receiving data from Ganesh about a backend semaphore object.
Definition: GrBackendSemaphore.h:23
SkImageInfo
Definition: SkImageInfo.h:283
SkSurface::makeSurface
sk_sp< SkSurface > makeSurface(int width, int height)
Calls makeSurface(ImageInfo) with the same ImageInfo as this surface, but with the specified width an...
SkISize
Definition: SkSize.h:13
SkSurface::writePixels
void writePixels(const SkBitmap &src, int dstX, int dstY)
Copies SkRect of pixels from the src SkBitmap to the SkSurface.
SkCanvas
Definition: SkCanvas.h:90
SkSurface::MakeNull
static sk_sp< SkSurface > MakeNull(int width, int height)
Returns SkSurface without backing pixels.
SkImage.h
SkSurface::ContentChangeMode
ContentChangeMode
Definition: SkSurface.h:480
SkSurfaceProps.h
SkSurface::MakeRasterDirect
static sk_sp< SkSurface > MakeRasterDirect(const SkPixmap &pm, const SkSurfaceProps *props=nullptr)
Definition: SkSurface.h:74
SkScalar
float SkScalar
Definition: SkScalar.h:16
SkSurface::draw
void draw(SkCanvas *canvas, SkScalar x, SkScalar y, const SkPaint *paint)
SkBudgeted
SkBudgeted
Indicates whether an allocation should count against a cache budget.
Definition: SkTypes.h:594
SkSurface::getBackendTexture
GrBackendTexture getBackendTexture(BackendHandleAccess backendHandleAccess)
Retrieves the back-end texture.
SkSurface::makeImageSnapshot
sk_sp< SkImage > makeImageSnapshot()
Returns SkImage capturing SkSurface contents.
SkImageInfo::width
int width() const
Returns pixel count in each row.
Definition: SkImageInfo.h:452
GrTypes.h
SkPixmap
Definition: SkPixmap.h:31
SkImage::RescaleGamma
RescaleGamma
Definition: SkImage.h:830
SkDeferredDisplayList
Definition: SkDeferredDisplayList.h:32
GrDirectContext
Definition: GrDirectContext.h:47
SkSurface::isCompatible
bool isCompatible(const SkSurfaceCharacterization &characterization) const
Is this surface compatible with the provided characterization?
SkSurface::draw
bool draw(sk_sp< const SkDeferredDisplayList > deferredDisplayList, int xOffset=0, int yOffset=0)
Draws the deferred display list created via a SkDeferredDisplayListRecorder.
SkSurface::readPixels
bool readPixels(const SkPixmap &dst, int srcX, int srcY)
Copies SkRect of pixels to dst.
SkSurface::readPixels
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY)
Copies SkRect of pixels from SkCanvas into dstPixels.
SkSurface::kFlushRead_BackendHandleAccess
@ kFlushRead_BackendHandleAccess
back-end object is readable
Definition: SkSurface.h:501
SkImage::AsyncReadResult
The result from asyncRescaleAndReadPixels() or asyncRescaleAndReadPixelsYUV420().
Definition: SkImage.h:806
SkIRect
Definition: SkRect.h:28
SkSurface::writePixels
void writePixels(const SkPixmap &src, int dstX, int dstY)
Copies SkRect of pixels from the src SkPixmap to the SkSurface.
SkPixmap::info
const SkImageInfo & info() const
Returns width, height, SkAlphaType, SkColorType, and SkColorSpace.
Definition: SkPixmap.h:126
SkSurface::width
int width() const
Returns pixel count in each row; may be zero or greater.
Definition: SkSurface.h:455
SkSurface::BackendSurfaceAccess
BackendSurfaceAccess
Definition: SkSurface.h:887
SkSurface::characterize
bool characterize(SkSurfaceCharacterization *characterization) const
Initializes SkSurfaceCharacterization that can be used to perform GPU back-end processing in a separa...
SkSurface::dirtyGenerationID
void dirtyGenerationID()
Definition: SkSurface.h:1044
SkSurfaceCharacterization
Definition: SkSurfaceCharacterization.h:207
SkSurface::MakeRenderTarget
static sk_sp< SkSurface > MakeRenderTarget(GrRecordingContext *context, SkBudgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, const SkSurfaceProps *surfaceProps)
Returns SkSurface on GPU indicated by context.
Definition: SkSurface.h:389
GrBackendTexture
Definition: GrBackendSurface.h:54
SK_API_AVAILABLE
#define SK_API_AVAILABLE(...)
Definition: SkTypes.h:426
SkSurface::recordingContext
GrRecordingContext * recordingContext()
Returns the recording context being used by the SkSurface.
SkSurface::readPixels
bool readPixels(const SkBitmap &dst, int srcX, int srcY)
Copies SkRect of pixels from SkSurface into bitmap.
GrBackendSurfaceMutableState
Since Skia and clients can both modify gpu textures and their connected state, Skia needs a way for c...
Definition: GrBackendSurfaceMutableState.h:27
SkColorType
SkColorType
Definition: SkImageInfo.h:64
SkSurface::replaceBackendTexture
bool replaceBackendTexture(const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, ContentChangeMode mode=kRetain_ContentChangeMode, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
If the surface was made via MakeFromBackendTexture then it's backing texture may be substituted with ...
SkSurface::wait
bool wait(int numSemaphores, const GrBackendSemaphore *waitSemaphores, bool deleteSemaphoresAfterWait=true)
Inserts a list of GPU semaphores that the current GPU-backed API must wait on before executing any mo...
SkSurface::generationID
uint32_t generationID()
Returns unique value identifying the content of SkSurface.
SkBitmap
Definition: SkBitmap.h:50
kBottomLeft_GrSurfaceOrigin
@ kBottomLeft_GrSurfaceOrigin
Definition: GrTypes.h:200
SkSurface::MakeRenderTarget
static sk_sp< SkSurface > MakeRenderTarget(GrRecordingContext *context, SkBudgeted budgeted, const SkImageInfo &imageInfo)
Returns SkSurface on GPU indicated by context.
Definition: SkSurface.h:409
SkSurface::MakeRasterDirectReleaseProc
static sk_sp< SkSurface > MakeRasterDirectReleaseProc(const SkImageInfo &imageInfo, void *pixels, size_t rowBytes, void(*releaseProc)(void *pixels, void *context), void *context, const SkSurfaceProps *surfaceProps=nullptr)
Allocates raster SkSurface.
SkSurface::MakeRaster
static sk_sp< SkSurface > MakeRaster(const SkImageInfo &imageInfo, const SkSurfaceProps *props=nullptr)
Allocates raster SkSurface.
Definition: SkSurface.h:147
SkSurface::ReadPixelsContext
void * ReadPixelsContext
Client-provided context that is passed to client-provided ReadPixelsContext.
Definition: SkSurface.h:749