aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkPixelRef.h
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-12-02 19:11:17 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-12-02 19:11:17 +0000
commitef843cdcd1be858fe55cc99ff134ffbd080c9a51 (patch)
tree7444455a3085d02aa86e3c5c3b0c2e0df2f264f8 /include/core/SkPixelRef.h
parentc62b0f8fd0cfaee1791e7bb4f349ad165df4f86b (diff)
When a bitmap is texture-backed, change SkBitmap::copyTo() to do a deep
copy of the texels in VRAM rather than a readback and re-upload. This gives a 3-10X speedup on recursive canvas-to-canvas draws. N.B.: This introduces a new GM test, which will need new baselines. git-svn-id: http://skia.googlecode.com/svn/trunk@2790 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkPixelRef.h')
-rw-r--r--include/core/SkPixelRef.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h
index 7e21a43192..374868e99e 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -10,10 +10,10 @@
#ifndef SkPixelRef_DEFINED
#define SkPixelRef_DEFINED
+#include "SkBitmap.h"
#include "SkRefCnt.h"
#include "SkString.h"
-class SkBitmap;
class SkColorTable;
struct SkIRect;
class SkMutex;
@@ -117,6 +117,12 @@ public:
bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL);
+ /** Makes a deep copy of this PixelRef, respecting the requested config.
+ Returns NULL if either there is an error (e.g. the destination could
+ not be created with the given config), or this PixelRef does not
+ support deep copies. */
+ virtual SkPixelRef* deepCopy(SkBitmap::Config config) { return NULL; }
+
// serialization
typedef SkPixelRef* (*Factory)(SkFlattenableReadBuffer&);