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

Unified Diff: src/core/SkYUVPlanesCache.h

Issue 851273003: YUV planes cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: static cast at the right spot Created 5 years, 11 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 | « src/core/SkMaskCache.cpp ('k') | src/core/SkYUVPlanesCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkYUVPlanesCache.h
diff --git a/src/core/SkYUVPlanesCache.h b/src/core/SkYUVPlanesCache.h
new file mode 100644
index 0000000000000000000000000000000000000000..aa9b89e2a55ae7c945f92469797a4d257af6e5c6
--- /dev/null
+++ b/src/core/SkYUVPlanesCache.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkYUVPlanesCache_DEFINED
+#define SkYUVPlanesCache_DEFINED
+
+#include "SkCachedData.h"
+#include "SkImageInfo.h"
+
+class SkResourceCache;
+
+class SkYUVPlanesCache {
+public:
+ /**
+ * The Info struct contains data about the 3 Y, U and V planes of memory stored
+ * contiguously, in that order, as a single block of memory within SkYUVPlanesCache.
reed2 2015/01/19 19:09:09 Well, I thought it was contiguous, but now perhaps
sugoi1 2015/01/19 19:28:56 Typically, block sizes are 8 and width and height
+ *
+ * fSize: Width and height of each of the 3 planes (in pixels).
+ * fSizeInMemory: Amount of memory allocated for each plane (may be different from
+ "height * rowBytes", depending on the jpeg decoder's block size).
+ * The sum of these is the total size stored within SkYUVPlanesCache.
+ * fRowBytes: rowBytes for each of the 3 planes (in bytes).
+ * fColorSpace: color space that will be used for the YUV -> RGB conversion.
+ */
+ struct Info {
+ SkISize fSize[3];
+ size_t fSizeInMemory[3];
+ size_t fRowBytes[3];
+ SkYUVColorSpace fColorSpace;
+ };
+ /**
+ * On success, return a ref to the SkCachedData that holds the pixels.
+ *
+ * On failure, return NULL.
+ */
+ static SkCachedData* FindAndRef(uint32_t genID, Info* info,
+ SkResourceCache* localCache = NULL);
+
+ /**
+ * Add a pixelRef ID and its YUV planes data to the cache.
+ */
+ static void Add(uint32_t genID, SkCachedData* data, Info* info,
+ SkResourceCache* localCache = NULL);
+};
+
+#endif
« no previous file with comments | « src/core/SkMaskCache.cpp ('k') | src/core/SkYUVPlanesCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698