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

Unified Diff: src/gpu/SkGrPriv.h

Issue 1397123002: Move functions from SkGr to SkGrPriv.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 9th time's a charm? 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/gpu/effects/GrTextureStripAtlas.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 36601fc3e3b918060dd81f3ab9cbf5fce03a303d..88bee5cc33041a304e8f6ab601d4ede40bfced09 100644
--- a/src/gpu/SkGrPriv.h
+++ b/src/gpu/SkGrPriv.h
@@ -9,6 +9,7 @@
#define SkGrPriv_DEFINED
#include "GrTypes.h"
+#include "GrBlend.h"
#include "GrTextureAccess.h"
#include "SkImageInfo.h"
#include "SkXfermode.h"
@@ -17,6 +18,7 @@ class GrCaps;
class GrContext;
class GrFragmentProcessor;
class GrPaint;
+class GrTexture;
class GrUniqueKey;
class SkPaint;
class SkMatrix;
@@ -94,6 +96,48 @@ inline bool SkPaintToGrPaintWithPrimitiveColor(GrContext* context, const SkPaint
false, grPaint);
}
+//////////////////////////////////////////////////////////////////////////////
+
bool GrTextureUsageSupported(const GrCaps&, int width, int height, SkImageUsageType);
+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.
+*/
+GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data,
+ int expectedW, int expectedH,
+ const void** outStartOfDataToUpload);
+
+bool GrIsImageInCache(const GrContext* ctx, uint32_t imageID, const SkIRect& subset,
+ GrTexture* nativeTexture, const GrTextureParams*);
+
+GrTexture* GrCreateTextureForPixels(GrContext*, const GrUniqueKey& optionalKey, GrSurfaceDesc,
+ SkPixelRef* pixelRefForInvalidationNotificationOrNull,
+ const void* pixels, size_t rowBytesOrZero);
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+GR_STATIC_ASSERT((int)kZero_GrBlendCoeff == (int)SkXfermode::kZero_Coeff);
+GR_STATIC_ASSERT((int)kOne_GrBlendCoeff == (int)SkXfermode::kOne_Coeff);
+GR_STATIC_ASSERT((int)kSC_GrBlendCoeff == (int)SkXfermode::kSC_Coeff);
+GR_STATIC_ASSERT((int)kISC_GrBlendCoeff == (int)SkXfermode::kISC_Coeff);
+GR_STATIC_ASSERT((int)kDC_GrBlendCoeff == (int)SkXfermode::kDC_Coeff);
+GR_STATIC_ASSERT((int)kIDC_GrBlendCoeff == (int)SkXfermode::kIDC_Coeff);
+GR_STATIC_ASSERT((int)kSA_GrBlendCoeff == (int)SkXfermode::kSA_Coeff);
+GR_STATIC_ASSERT((int)kISA_GrBlendCoeff == (int)SkXfermode::kISA_Coeff);
+GR_STATIC_ASSERT((int)kDA_GrBlendCoeff == (int)SkXfermode::kDA_Coeff);
+GR_STATIC_ASSERT((int)kIDA_GrBlendCoeff == (int)SkXfermode::kIDA_Coeff);
+GR_STATIC_ASSERT(SkXfermode::kCoeffCount == 10);
+
+#define SkXfermodeCoeffToGrBlendCoeff(X) ((GrBlendCoeff)(X))
+
#endif
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/gpu/effects/GrTextureStripAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698