aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-06 20:31:45 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-06 20:31:45 +0000
commit473f0aa2bb218e50fce5e19063f8c8fdaf57fad4 (patch)
tree2853d1598163631a97d7a3ba99d5432adb210de7 /include/gpu
parentcc63b32eb8702bfa4d965fa443cf00fc1c1d10b7 (diff)
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 4174afb18a9746bbad2a06c0ec2d4ad35f72d790. BUG= Review URL: https://codereview.chromium.org/108723003 git-svn-id: http://skia.googlecode.com/svn/trunk@12547 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.h11
3 files changed, 9 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 da4b8fae09..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,7 @@ public:
* cache and would like the pixel ref to unlock it in its destructor then transferCacheLock
* should be set to true.
*/
- SkGrPixelRef(GrSurface* surface, bool transferCacheLock = false);
+ SkGrPixelRef(const SkImageInfo&, GrSurface*, bool transferCacheLock = false);
virtual ~SkGrPixelRef();
// override from SkPixelRef