Flutter Engine
The Flutter Engine
|
#include "include/core/SkBlendMode.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkSamplingOptions.h"
#include "include/core/SkTileMode.h"
#include "include/core/SkTypes.h"
#include "include/gpu/GpuTypes.h"
#include "include/private/SkColorData.h"
#include "src/gpu/Blend.h"
#include "src/gpu/SkBackingFit.h"
#include "src/gpu/ganesh/GrColor.h"
#include "src/gpu/ganesh/GrSamplerState.h"
#include <cstdint>
#include <memory>
#include <string_view>
#include <tuple>
Go to the source code of this file.
Namespaces | |
namespace | skgpu |
Enumerations | |
enum class | GrImageTexGenPolicy : int { kDraw , kNew_Uncached_Unbudgeted , kNew_Uncached_Budgeted } |
|
strong |
Policies for how to create textures for SkImages (and SkBitmaps).
Enumerator | |
---|---|
kDraw | |
kNew_Uncached_Unbudgeted | |
kNew_Uncached_Budgeted |
Definition at line 141 of file SkGr.h.
sk_sp< GrSurfaceProxy > GrCopyBaseMipMapToTextureProxy | ( | GrRecordingContext * | ctx, |
sk_sp< GrSurfaceProxy > | baseProxy, | ||
GrSurfaceOrigin | origin, | ||
std::string_view | label, | ||
skgpu::Budgeted | budgeted = skgpu::Budgeted::kYes |
||
) |
Creates a new texture with mipmap levels and copies the baseProxy into the base layer.
Definition at line 107 of file SkGr.cpp.
GrSurfaceProxyView GrCopyBaseMipMapToView | ( | GrRecordingContext * | context, |
GrSurfaceProxyView | src, | ||
skgpu::Budgeted | budgeted = skgpu::Budgeted::kYes |
||
) |
Same as GrCopyBaseMipMapToTextureProxy but takes the src as a view and returns a view with same origin and swizzle as the src view.
Definition at line 136 of file SkGr.cpp.
std::tuple< GrSurfaceProxyView, GrColorType > GrMakeCachedBitmapProxyView | ( | GrRecordingContext * | rContext, |
const SkBitmap & | bitmap, | ||
std::string_view | label, | ||
skgpu::Mipmapped | mipmapped = skgpu::Mipmapped::kNo |
||
) |
Definition at line 188 of file SkGr.cpp.
void GrMakeKeyFromImageID | ( | skgpu::UniqueKey * | key, |
uint32_t | imageID, | ||
const SkIRect & | imageBounds | ||
) |
Our key includes the offset, width, and height so that bitmaps created by extractSubset() are unique.
The imageID is in the shared namespace (see SkNextID::ImageID())
std::tuple< GrSurfaceProxyView, GrColorType > GrMakeUncachedBitmapProxyView | ( | GrRecordingContext * | rContext, |
const SkBitmap & | bitmap, | ||
skgpu::Mipmapped | mipmapped = skgpu::Mipmapped::kNo , |
||
SkBackingFit | fit = SkBackingFit::kExact , |
||
skgpu::Budgeted | budgeted = skgpu::Budgeted::kYes |
||
) |
Like above but always uploads the bitmap and never inserts into the cache. Unlike above, the texture may be approx or scratch and budgeted or not.
sk_sp< SkIDChangeListener > GrMakeUniqueKeyInvalidationListener | ( | skgpu::UniqueKey * | key, |
uint32_t | contextID | ||
) |
Makes a SkIDChangeListener from a skgpu::UniqueKey. The key will be invalidated in the resource cache if the ID becomes invalid. This also modifies the key so that it will cause the listener to be deregistered if the key is destroyed (to prevent unbounded listener growth when resources are purged before listeners trigger).
Definition at line 75 of file SkGr.cpp.
|
inlinestatic |
Definition at line 211 of file SkGr.h.
SkColor4f SkColor4fPrepForDst | ( | SkColor4f | color, |
const GrColorInfo & | colorInfo | ||
) |
Converts an SkColor4f to the destination color space.
SkPMColor4f SkColorToPMColor4f | ( | SkColor | c, |
const GrColorInfo & | colorInfo | ||
) |
Definition at line 51 of file SkGr.h.
bool SkPaintToGrPaint | ( | GrRecordingContext * | context, |
const GrColorInfo & | dstColorInfo, | ||
const SkPaint & | skPaint, | ||
const SkMatrix & | ctm, | ||
const SkSurfaceProps & | surfaceProps, | ||
GrPaint * | grPaint | ||
) |
Converts an SkPaint to a GrPaint for a given GrRecordingContext. The matrix is required in order to convert the SkShader (if any) on the SkPaint. The primitive itself has no color.
Definition at line 553 of file SkGr.cpp.
bool SkPaintToGrPaintReplaceShader | ( | GrRecordingContext * | context, |
const GrColorInfo & | dstColorInfo, | ||
const SkPaint & | skPaint, | ||
const SkMatrix & | ctm, | ||
std::unique_ptr< GrFragmentProcessor > | shaderFP, | ||
const SkSurfaceProps & | surfaceProps, | ||
GrPaint * | grPaint | ||
) |
Replaces the SkShader (if any) on skPaint with the passed in GrFragmentProcessor, if not null. If null then it is assumed that the geometry processor is implementing a shader replacement. The processor should expect an unpremul input color and produce a premultiplied output color.
Replaces the SkShader (if any) on skPaint with the passed in GrFragmentProcessor.
Definition at line 570 of file SkGr.cpp.
bool SkPaintToGrPaintWithBlend | ( | GrRecordingContext * | context, |
const GrColorInfo & | dstColorInfo, | ||
const SkPaint & | skPaint, | ||
const SkMatrix & | ctm, | ||
SkBlender * | primColorBlender, | ||
const SkSurfaceProps & | surfaceProps, | ||
GrPaint * | grPaint | ||
) |
Blends the SkPaint's shader (or color if no shader) with the color which specified via a GrOp's GrPrimitiveProcesssor.
Blends the SkPaint's shader (or color if no shader) with a per-primitive color which must be setup as a vertex attribute using the specified SkBlender.
Definition at line 589 of file SkGr.cpp.
|
staticconstexpr |
Definition at line 77 of file SkGr.h.