aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar rileya@google.com <rileya@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-18 21:47:40 +0000
committerGravatar rileya@google.com <rileya@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-18 21:47:40 +0000
commit24f3ad1bbb44916cae33f5d3cf2a20af4bbc381f (patch)
tree90e8fb73d447bd415e7411e494ca3d5dd4c5f504 /include/gpu
parent580711694654b8edc70028d09c4211445b661466 (diff)
Move texture lock/unlock functions from SkGpuDevice into SkGr as global functions, also removed inconsistent "SkGr" class.
Review URL: https://codereview.appspot.com/6420048 git-svn-id: http://skia.googlecode.com/svn/trunk@4664 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/SkGpuDevice.h3
-rw-r--r--include/gpu/SkGr.h46
2 files changed, 22 insertions, 27 deletions
diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h
index 2390cdb44c..2af11499ad 100644
--- a/include/gpu/SkGpuDevice.h
+++ b/include/gpu/SkGpuDevice.h
@@ -117,11 +117,8 @@ public:
protected:
typedef GrContext::TextureCacheEntry TexCache;
- TexCache lockCachedTexture(const SkBitmap& bitmap,
- const GrSamplerState* sampler);
bool isBitmapInTextureCache(const SkBitmap& bitmap,
const GrSamplerState& sampler) const;
- void unlockCachedTexture(TexCache);
// overrides from SkDevice
virtual bool onReadPixels(const SkBitmap& bitmap,
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index 44a351eb74..975a1bad44 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -68,23 +68,28 @@ GR_STATIC_ASSERT((int)SkPath::kDone_Verb == (int)kEnd_PathCmd);
#include "SkColorPriv.h"
-class SkGr {
-public:
- /**
- * Convert the SkBitmap::Config to the corresponding PixelConfig, or
- * kUnknown_PixelConfig if the conversion cannot be done.
- */
- static GrPixelConfig BitmapConfig2PixelConfig(SkBitmap::Config);
-
- static GrColor SkColor2GrColor(SkColor c) {
- SkPMColor pm = SkPreMultiplyColor(c);
- unsigned r = SkGetPackedR32(pm);
- unsigned g = SkGetPackedG32(pm);
- unsigned b = SkGetPackedB32(pm);
- unsigned a = SkGetPackedA32(pm);
- return GrColorPackRGBA(r, g, b, a);
- }
-};
+/**
+ * Convert the SkBitmap::Config to the corresponding PixelConfig, or
+ * kUnknown_PixelConfig if the conversion cannot be done.
+ */
+GrPixelConfig SkBitmapConfig2GrPixelConfig(SkBitmap::Config);
+
+static inline GrColor SkColor2GrColor(SkColor c) {
+ SkPMColor pm = SkPreMultiplyColor(c);
+ unsigned r = SkGetPackedR32(pm);
+ unsigned g = SkGetPackedG32(pm);
+ unsigned b = SkGetPackedB32(pm);
+ unsigned a = SkGetPackedA32(pm);
+ return GrColorPackRGBA(r, g, b, a);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+GrContext::TextureCacheEntry GrLockCachedBitmapTexture(GrContext* ctx,
+ const SkBitmap& bitmap,
+ const GrSamplerState* sampler);
+
+void GrUnlockCachedBitmapTexture(GrContext* ctx, GrContext::TextureCacheEntry cache);
////////////////////////////////////////////////////////////////////////////////
// Classes
@@ -150,12 +155,5 @@ private:
};
////////////////////////////////////////////////////////////////////////////////
-// Helper functions
-
-GrContext::TextureCacheEntry sk_gr_create_bitmap_texture(GrContext* ctx,
- uint64_t key,
- const GrSamplerState* sampler,
- const SkBitmap& bitmap);
-
#endif