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

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

Issue 1903483003: Add onImageInfo call to SkImage_Base. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ImageInfo changes. Created 4 years, 8 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/image/SkImage_Generator.cpp ('k') | src/image/SkImage_Raster.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
11 #include "SkAtomics.h" 11 #include "SkAtomics.h"
12 #include "GrTexture.h" 12 #include "GrTexture.h"
13 #include "GrGpuResourcePriv.h" 13 #include "GrGpuResourcePriv.h"
14 #include "SkBitmap.h" 14 #include "SkBitmap.h"
15 #include "SkGr.h"
15 #include "SkImage_Base.h" 16 #include "SkImage_Base.h"
16 #include "SkImagePriv.h" 17 #include "SkImagePriv.h"
17 #include "SkSurface.h" 18 #include "SkSurface.h"
18 19
19 class SkImage_Gpu : public SkImage_Base { 20 class SkImage_Gpu : public SkImage_Base {
20 public: 21 public:
21 /** 22 /**
22 * An "image" can be a subset/window into a larger texture, so we explicit take the 23 * An "image" can be a subset/window into a larger texture, so we explicit take the
23 * width and height. 24 * width and height.
24 */ 25 */
25 SkImage_Gpu(int w, int h, uint32_t uniqueID, SkAlphaType, GrTexture*, SkBudg eted); 26 SkImage_Gpu(int w, int h, uint32_t uniqueID, SkAlphaType, GrTexture*, SkBudg eted);
26 ~SkImage_Gpu() override; 27 ~SkImage_Gpu() override;
27 28
29 SkImageInfo onImageInfo() const override {
30 return GrMakeInfoFromTexture(fTexture, fTexture->width(), fTexture->heig ht(), isOpaque());
31 }
32
28 void applyBudgetDecision() const { 33 void applyBudgetDecision() const {
29 if (SkBudgeted::kYes == fBudgeted) { 34 if (SkBudgeted::kYes == fBudgeted) {
30 fTexture->resourcePriv().makeBudgeted(); 35 fTexture->resourcePriv().makeBudgeted();
31 } else { 36 } else {
32 fTexture->resourcePriv().makeUnbudgeted(); 37 fTexture->resourcePriv().makeUnbudgeted();
33 } 38 }
34 } 39 }
35 40
36 bool getROPixels(SkBitmap*, CachingHint) const override; 41 bool getROPixels(SkBitmap*, CachingHint) const override;
37 GrTexture* asTextureRef(GrContext* ctx, const GrTextureParams& params) const override; 42 GrTexture* asTextureRef(GrContext* ctx, const GrTextureParams& params) const override;
(...skipping 14 matching lines...) Expand all
52 SkAutoTUnref<GrTexture> fTexture; 57 SkAutoTUnref<GrTexture> fTexture;
53 const SkAlphaType fAlphaType; 58 const SkAlphaType fAlphaType;
54 const SkBudgeted fBudgeted; 59 const SkBudgeted fBudgeted;
55 mutable SkAtomic<bool> fAddedRasterVersionToCache; 60 mutable SkAtomic<bool> fAddedRasterVersionToCache;
56 61
57 62
58 typedef SkImage_Base INHERITED; 63 typedef SkImage_Base INHERITED;
59 }; 64 };
60 65
61 #endif 66 #endif
OLDNEW
« no previous file with comments | « src/image/SkImage_Generator.cpp ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698