diff options
Diffstat (limited to 'src/gpu/SkGrPriv.h')
-rw-r--r-- | src/gpu/SkGrPriv.h | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/src/gpu/SkGrPriv.h b/src/gpu/SkGrPriv.h index 593530997f..c92e580885 100644 --- a/src/gpu/SkGrPriv.h +++ b/src/gpu/SkGrPriv.h @@ -26,18 +26,34 @@ class SkPaint; class SkPixelRef; struct SkIRect; +struct SkGrStretch { + enum Type { + kNone_Type, + kBilerp_Type, + kNearest_Type + } fType; + int fWidth; + int fHeight; +}; + /** * 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()) + * The imageID is in the shared namespace (see SkNextID::ImageID() * - SkBitmap/SkPixelRef * - SkImage * - SkImageGenerator * * Note: width/height must fit in 16bits for this impl. */ -void GrMakeKeyFromImageID(GrUniqueKey* key, uint32_t imageID, const SkIRect& imageBounds); +void GrMakeKeyFromImageID(GrUniqueKey* key, uint32_t imageID, const SkIRect& imageBounds, + const GrCaps&, const GrTextureParams&); + +/** + * Given an "unstretched" key, and a stretch rec, produce a stretched key. + */ +bool GrMakeStretchedKey(const GrUniqueKey& origKey, const SkGrStretch&, GrUniqueKey* stretchedKey); /** Converts an SkPaint to a GrPaint for a given GrContext. The matrix is required in order to convert the SkShader (if any) on the SkPaint. The primitive itself has no color. */ @@ -87,24 +103,21 @@ GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&); bool GrPixelConfig2ColorAndProfileType(GrPixelConfig, SkColorType*, SkColorProfileType*); /** - * If the compressed data in the SkData is supported (as a texture format, this returns - * the pixel-config that should be used, and sets outStartOfDataToUpload to the ptr into - * the data where the actual raw data starts (skipping any header bytes). - * - * If the compressed data is not supported, this returns kUnknown_GrPixelConfig, and - * ignores outStartOfDataToUpload. - */ +* If the compressed data in the SkData is supported (as a texture format, this returns +* the pixel-config that should be used, and sets outStartOfDataToUpload to the ptr into +* the data where the actual raw data starts (skipping any header bytes). +* +* If the compressed data is not supported, this returns kUnknown_GrPixelConfig, and +* ignores outStartOfDataToUpload. +*/ GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data, int expectedW, int expectedH, const void** outStartOfDataToUpload); +GrTexture* GrCreateTextureForPixels(GrContext*, const GrUniqueKey& optionalKey, GrSurfaceDesc, + SkPixelRef* pixelRefForInvalidationNotificationOrNull, + const void* pixels, size_t rowBytesOrZero); -/** - * Creates a new texture for the bitmap. Does not concern itself with cache keys or texture params. - * The bitmap must have CPU-accessible pixels. Attempts to take advantage of faster paths for - * compressed textures and yuv planes. - */ -GrTexture* GrUploadBitmapToTexture(GrContext*, const SkBitmap&); ////////////////////////////////////////////////////////////////////////////// |