Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: src/gpu/SkGrPriv.h

Issue 1409923003: Revert of Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what… (Closed) Base URL: https://skia.googlesource.com/skia.git@move
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGrPriv.h
diff --git a/src/gpu/SkGrPriv.h b/src/gpu/SkGrPriv.h
index 593530997fd69bda5f0f4defd440709f041e911e..c92e580885e66bbee0d92065e49695d60ac7771e 100644
--- a/src/gpu/SkGrPriv.h
+++ b/src/gpu/SkGrPriv.h
@@ -26,18 +26,34 @@
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 @@
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&);
//////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698