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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/core/SkMaskCache.cpp ('k') | src/core/SkYUVPlanesCache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkYUVPlanesCache_DEFINED
9 #define SkYUVPlanesCache_DEFINED
10
11 #include "SkCachedData.h"
12 #include "SkImageInfo.h"
13
14 class SkResourceCache;
15
16 class SkYUVPlanesCache {
17 public:
18 /**
19 * The Info struct contains data about the 3 Y, U and V planes of memory sto red
20 * contiguously, in that order, as a single block of memory within SkYUVPlan esCache.
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
21 *
22 * fSize: Width and height of each of the 3 planes (in pixels).
23 * fSizeInMemory: Amount of memory allocated for each plane (may be differen t from
24 "height * rowBytes", depending on the jpeg decoder's block size).
25 * The sum of these is the total size stored within SkYUVPlan esCache.
26 * fRowBytes: rowBytes for each of the 3 planes (in bytes).
27 * fColorSpace: color space that will be used for the YUV -> RGB conversion.
28 */
29 struct Info {
30 SkISize fSize[3];
31 size_t fSizeInMemory[3];
32 size_t fRowBytes[3];
33 SkYUVColorSpace fColorSpace;
34 };
35 /**
36 * On success, return a ref to the SkCachedData that holds the pixels.
37 *
38 * On failure, return NULL.
39 */
40 static SkCachedData* FindAndRef(uint32_t genID, Info* info,
41 SkResourceCache* localCache = NULL);
42
43 /**
44 * Add a pixelRef ID and its YUV planes data to the cache.
45 */
46 static void Add(uint32_t genID, SkCachedData* data, Info* info,
47 SkResourceCache* localCache = NULL);
48 };
49
50 #endif
OLDNEW
« 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