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

Unified Diff: include/core/SkPicture.h

Issue 197123003: Proposed SkCanvas API for preLoading textures to VRAM v2.0 (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: retry upload Created 6 years, 9 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 | « include/core/SkDevice.h ('k') | include/gpu/SkGpuDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPicture.h
===================================================================
--- include/core/SkPicture.h (revision 13812)
+++ include/core/SkPicture.h (working copy)
@@ -34,6 +34,27 @@
public:
SK_DECLARE_INST_COUNT(SkPicture)
+ // AccelData provides a base class for device-specific acceleration
+ // data. It is added to the picture via a call to a device's optimize
+ // method.
+ class AccelData : public SkRefCnt {
+ public:
+ typedef uint8_t Domain;
+ typedef uint32_t Key;
+
+ AccelData(Key key) : fKey(key) { }
+
+ const Key& getKey() const { return fKey; }
+
+ // This entry point allows user's to get a unique domain prefix
+ // for their keys
+ static Domain GenerateDomain();
+ private:
+ Key fKey;
+
+ typedef SkRefCnt INHERITED;
+ };
+
/** The constructor prepares the picture to record.
@param width the width of the virtual device the picture records.
@param height the height of the virtual device the picture records.
@@ -44,6 +65,18 @@
*/
SkPicture(const SkPicture& src);
+ /** PRIVATE / EXPERIMENTAL -- do not call */
+ void EXPERIMENTAL_addAccelData(const AccelData* data) {
+ SkRefCnt_SafeAssign(fAccelData, data);
+ }
+ /** PRIVATE / EXPERIMENTAL -- do not call */
+ const AccelData* EXPERIMENTAL_getAccelData(AccelData::Key key) const {
+ if (NULL != fAccelData && fAccelData->getKey() == key) {
+ return fAccelData;
+ }
+ return NULL;
+ }
+
/**
* Function signature defining a function that sets up an SkBitmap from encoded data. On
* success, the SkBitmap should have its Config, width, height, rowBytes and pixelref set.
@@ -262,9 +295,10 @@
// fPlayback, fRecord, fWidth & fHeight are protected to allow derived classes to
// install their own SkPicturePlayback-derived players,SkPictureRecord-derived
// recorders and set the picture size
- SkPicturePlayback* fPlayback;
- SkPictureRecord* fRecord;
- int fWidth, fHeight;
+ SkPicturePlayback* fPlayback;
+ SkPictureRecord* fRecord;
+ int fWidth, fHeight;
+ const AccelData* fAccelData;
// Create a new SkPicture from an existing SkPicturePlayback. Ref count of
// playback is unchanged.
« no previous file with comments | « include/core/SkDevice.h ('k') | include/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698