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

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

Issue 1370223002: Revert[4] of add ImageShader, sharing code with its Bitmap cousin (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 * If the underlying src naturally is represented by an encoded blob (in Sk Data), this returns 51 * If the underlying src naturally is represented by an encoded blob (in Sk Data), this returns
52 * a ref to that data. If not, it returns null. 52 * a ref to that data. If not, it returns null.
53 */ 53 */
54 SkData* refEncoded(); 54 SkData* refEncoded();
55 55
56 private: 56 private:
57 SkImageCacherator(SkImageGenerator*, const SkImageInfo&, const SkIPoint&, ui nt32_t uniqueID); 57 SkImageCacherator(SkImageGenerator*, const SkImageInfo&, const SkIPoint&, ui nt32_t uniqueID);
58 58
59 bool generateBitmap(SkBitmap*); 59 bool generateBitmap(SkBitmap*);
60 bool tryLockAsBitmap(SkBitmap*, const SkImage*); 60 bool tryLockAsBitmap(SkBitmap*, const SkImage*);
61 #if SK_SUPPORT_GPU
62 GrTexture* lockUnstretchedTexture(GrContext*, SkImageUsageType, const SkImag e* client);
63 #endif
61 64
62 class ScopedGenerator { 65 class ScopedGenerator {
63 SkImageCacherator* fCacher; 66 SkImageCacherator* fCacher;
64 public: 67 public:
65 ScopedGenerator(SkImageCacherator* cacher) : fCacher(cacher) { 68 ScopedGenerator(SkImageCacherator* cacher) : fCacher(cacher) {
66 fCacher->fMutexForGenerator.acquire(); 69 fCacher->fMutexForGenerator.acquire();
67 } 70 }
68 ~ScopedGenerator() { 71 ~ScopedGenerator() {
69 fCacher->fMutexForGenerator.release(); 72 fCacher->fMutexForGenerator.release();
70 } 73 }
71 SkImageGenerator* operator->() const { return fCacher->fNotThreadSafeGen erator; } 74 SkImageGenerator* operator->() const { return fCacher->fNotThreadSafeGen erator; }
72 operator SkImageGenerator*() const { return fCacher->fNotThreadSafeGener ator; } 75 operator SkImageGenerator*() const { return fCacher->fNotThreadSafeGener ator; }
73 }; 76 };
74 77
75 SkMutex fMutexForGenerator; 78 SkMutex fMutexForGenerator;
76 SkAutoTDelete<SkImageGenerator> fNotThreadSafeGenerator; 79 SkAutoTDelete<SkImageGenerator> fNotThreadSafeGenerator;
77 80
78 const SkImageInfo fInfo; 81 const SkImageInfo fInfo;
79 const SkIPoint fOrigin; 82 const SkIPoint fOrigin;
80 const uint32_t fUniqueID; 83 const uint32_t fUniqueID;
84
85 friend class Cacherator_GrTextureMaker;
81 }; 86 };
82 87
83 #endif 88 #endif
OLDNEW
« no previous file with comments | « gyp/core.gypi ('k') | src/core/SkImageCacherator.cpp » ('j') | src/gpu/SkGr.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698