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

Side by Side Diff: src/image/SkImage_Gpu.h

Issue 2337803002: Don't copy image buffer when calculating size.
Patch Set: Making SkImage_Gpu always return false. Created 4 years, 1 month 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/image/SkImage_Generator.cpp ('k') | src/image/SkImage_Gpu.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 SkImage_Gpu_DEFINED 8 #ifndef SkImage_Gpu_DEFINED
9 #define SkImage_Gpu_DEFINED 9 #define SkImage_Gpu_DEFINED
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 SkDestinationSurfaceColorMode) const override; 43 SkDestinationSurfaceColorMode) const override;
44 sk_sp<SkImage> onMakeSubset(const SkIRect&) const override; 44 sk_sp<SkImage> onMakeSubset(const SkIRect&) const override;
45 45
46 GrTexture* peekTexture() const override { return fTexture.get(); } 46 GrTexture* peekTexture() const override { return fTexture.get(); }
47 sk_sp<GrTexture> refPinnedTexture(uint32_t* uniqueID) const override { 47 sk_sp<GrTexture> refPinnedTexture(uint32_t* uniqueID) const override {
48 *uniqueID = this->uniqueID(); 48 *uniqueID = this->uniqueID();
49 return fTexture; 49 return fTexture;
50 } 50 }
51 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, 51 bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes,
52 int srcX, int srcY, CachingHint) const override; 52 int srcX, int srcY, CachingHint) const override;
53 #if SK_SUPPORT_GPU
54 bool canGenerateTexture(const GrContextThreadSafeProxy& proxy) const overrid e
55 {
56 return false;
57 /*
58 if (fTexture) {
59 return fTexture->getContext()->uniqueID() == proxy.uniqueID();
60 }
61 return false;
62 */
63 }
64 #endif
53 65
54 private: 66 private:
55 sk_sp<GrTexture> fTexture; 67 sk_sp<GrTexture> fTexture;
56 const SkAlphaType fAlphaType; 68 const SkAlphaType fAlphaType;
57 const SkBudgeted fBudgeted; 69 const SkBudgeted fBudgeted;
58 sk_sp<SkColorSpace> fColorSpace; 70 sk_sp<SkColorSpace> fColorSpace;
59 mutable SkAtomic<bool> fAddedRasterVersionToCache; 71 mutable SkAtomic<bool> fAddedRasterVersionToCache;
60 72
61 73
62 typedef SkImage_Base INHERITED; 74 typedef SkImage_Base INHERITED;
63 }; 75 };
64 76
65 #endif 77 #endif
OLDNEW
« no previous file with comments | « src/image/SkImage_Generator.cpp ('k') | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698