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

Side by Side Diff: src/core/SkImageCacherator.h

Issue 1403313003: Remove params from Cacherator_GrTextureMaker (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: correct_key Created 5 years, 2 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 | « include/core/SkImageGenerator.h ('k') | src/core/SkImageCacherator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkImageCacherator_DEFINED 8 #ifndef SkImageCacherator_DEFINED
9 #define SkImageCacherator_DEFINED 9 #define SkImageCacherator_DEFINED
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 * a ref to that data. If not, it returns null. 53 * a ref to that data. If not, it returns null.
54 */ 54 */
55 SkData* refEncoded(); 55 SkData* refEncoded();
56 56
57 private: 57 private:
58 SkImageCacherator(SkImageGenerator*, const SkImageInfo&, const SkIPoint&, ui nt32_t uniqueID); 58 SkImageCacherator(SkImageGenerator*, const SkImageInfo&, const SkIPoint&, ui nt32_t uniqueID);
59 59
60 bool generateBitmap(SkBitmap*); 60 bool generateBitmap(SkBitmap*);
61 bool tryLockAsBitmap(SkBitmap*, const SkImage*); 61 bool tryLockAsBitmap(SkBitmap*, const SkImage*);
62 #if SK_SUPPORT_GPU 62 #if SK_SUPPORT_GPU
63 GrTexture* lockUnstretchedTexture(GrContext*, const GrTextureParams&, const SkImage* client); 63 GrTexture* lockUnstretchedTexture(GrContext*, const SkImage* client);
64 #endif 64 #endif
65 65
66 class ScopedGenerator { 66 class ScopedGenerator {
67 SkImageCacherator* fCacher; 67 SkImageCacherator* fCacher;
68 public: 68 public:
69 ScopedGenerator(SkImageCacherator* cacher) : fCacher(cacher) { 69 ScopedGenerator(SkImageCacherator* cacher) : fCacher(cacher) {
70 fCacher->fMutexForGenerator.acquire(); 70 fCacher->fMutexForGenerator.acquire();
71 } 71 }
72 ~ScopedGenerator() { 72 ~ScopedGenerator() {
73 fCacher->fMutexForGenerator.release(); 73 fCacher->fMutexForGenerator.release();
74 } 74 }
75 SkImageGenerator* operator->() const { return fCacher->fNotThreadSafeGen erator; } 75 SkImageGenerator* operator->() const { return fCacher->fNotThreadSafeGen erator; }
76 operator SkImageGenerator*() const { return fCacher->fNotThreadSafeGener ator; } 76 operator SkImageGenerator*() const { return fCacher->fNotThreadSafeGener ator; }
77 }; 77 };
78 78
79 SkMutex fMutexForGenerator; 79 SkMutex fMutexForGenerator;
80 SkAutoTDelete<SkImageGenerator> fNotThreadSafeGenerator; 80 SkAutoTDelete<SkImageGenerator> fNotThreadSafeGenerator;
81 81
82 const SkImageInfo fInfo; 82 const SkImageInfo fInfo;
83 const SkIPoint fOrigin; 83 const SkIPoint fOrigin;
84 const uint32_t fUniqueID; 84 const uint32_t fUniqueID;
85 85
86 friend class Cacherator_GrTextureMaker; 86 friend class Cacherator_GrTextureMaker;
87 }; 87 };
88 88
89 #endif 89 #endif
OLDNEW
« no previous file with comments | « include/core/SkImageGenerator.h ('k') | src/core/SkImageCacherator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698