aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-11 18:38:46 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-11 18:38:46 +0000
commitf3aead2829fa515f790631ee65784a7b9b073343 (patch)
tree24de164e4a739d5aa0d03b875775b94b86e0c9e6 /include/gpu
parent6a32add491cc736aab95561d137909cd7c5d65ef (diff)
remvoe duplicate impl for SkImageInfo flattening
Revert "Revert "PixelRef now returns (nearly) everything that is currently in SkBitmap. The goal is to refactor bitmap later to remove redundancy, and more interestingly, remove the chance for a disconnect between the actual (pixelref) rowbytes and config, and the one claimed by the bitmap."""""" This reverts commit eabd6b2ed4e494b323c08f32358f45950a0368c3. BUG= Review URL: https://codereview.chromium.org/108773003 git-svn-id: http://skia.googlecode.com/svn/trunk@12624 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrSurface.h3
-rw-r--r--include/gpu/SkGr.h1
-rw-r--r--include/gpu/SkGrPixelRef.h10
3 files changed, 8 insertions, 6 deletions
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index c401a905ff..15e44ab593 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -15,6 +15,7 @@
class GrTexture;
class GrRenderTarget;
+struct SkImageInfo;
class GrSurface : public GrResource {
public:
@@ -58,6 +59,8 @@ public:
*/
const GrTextureDesc& desc() const { return fDesc; }
+ void asImageInfo(SkImageInfo*) const;
+
/**
* @return the texture associated with the surface, may be NULL.
*/
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index 5e5ca4b72c..db08548f5d 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -50,6 +50,7 @@ GR_STATIC_ASSERT((int)kIDA_GrBlendCoeff == (int)SkXfermode::kIDA_Coeff);
* kUnknown_PixelConfig if the conversion cannot be done.
*/
GrPixelConfig SkBitmapConfig2GrPixelConfig(SkBitmap::Config);
+bool GrPixelConfig2ColorType(GrPixelConfig, SkColorType*);
static inline GrColor SkColor2GrColor(SkColor c) {
SkPMColor pm = SkPreMultiplyColor(c);
diff --git a/include/gpu/SkGrPixelRef.h b/include/gpu/SkGrPixelRef.h
index c29c27fb3b..4d33b9d06b 100644
--- a/include/gpu/SkGrPixelRef.h
+++ b/include/gpu/SkGrPixelRef.h
@@ -23,14 +23,13 @@
*/
class SK_API SkROLockPixelsPixelRef : public SkPixelRef {
public:
- SkROLockPixelsPixelRef();
+ SkROLockPixelsPixelRef(const SkImageInfo&);
virtual ~SkROLockPixelsPixelRef();
protected:
- // override from SkPixelRef
- virtual void* onLockPixels(SkColorTable** ptr);
- virtual void onUnlockPixels();
- virtual bool onLockPixelsAreWritable() const; // return false;
+ virtual bool onNewLockPixels(LockRec*) SK_OVERRIDE;
+ virtual void onUnlockPixels() SK_OVERRIDE;
+ virtual bool onLockPixelsAreWritable() const SK_OVERRIDE; // return false;
private:
SkBitmap fBitmap;
@@ -47,7 +46,6 @@ public:
* cache and would like the pixel ref to unlock it in its destructor then transferCacheLock
* should be set to true.
*/
- SkGrPixelRef(GrSurface*, bool transferCacheLock = false);
SkGrPixelRef(const SkImageInfo&, GrSurface*, bool transferCacheLock = false);
virtual ~SkGrPixelRef();