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

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

Issue 920513003: Make filters use SkImage instead of SkBitmap Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 SkImage_Gpu_DEFINED 8 #ifndef SkImage_Gpu_DEFINED
9 #define SkImage_Gpu_DEFINED 9 #define SkImage_Gpu_DEFINED
10 10
(...skipping 18 matching lines...) Expand all
29 bool getROPixels(SkBitmap*) const SK_OVERRIDE; 29 bool getROPixels(SkBitmap*) const SK_OVERRIDE;
30 30
31 GrTexture* getTexture() const { return fBitmap.getTexture(); } 31 GrTexture* getTexture() const { return fBitmap.getTexture(); }
32 32
33 SkShader* onNewShader(SkShader::TileMode, 33 SkShader* onNewShader(SkShader::TileMode,
34 SkShader::TileMode, 34 SkShader::TileMode,
35 const SkMatrix* localMatrix) const SK_OVERRIDE ; 35 const SkMatrix* localMatrix) const SK_OVERRIDE ;
36 36
37 bool isOpaque() const SK_OVERRIDE; 37 bool isOpaque() const SK_OVERRIDE;
38 38
39 size_t getSize() const SK_OVERRIDE { return fBitmap.getSize(); }
40
39 void applyBudgetDecision() const { 41 void applyBudgetDecision() const {
40 if (fBudgeted) { 42 if (fBudgeted) {
41 fBitmap.getTexture()->cacheAccess().makeBudgeted(); 43 fBitmap.getTexture()->cacheAccess().makeBudgeted();
42 } else { 44 } else {
43 fBitmap.getTexture()->cacheAccess().makeUnbudgeted(); 45 fBitmap.getTexture()->cacheAccess().makeUnbudgeted();
44 } 46 }
45 } 47 }
46 48
47 private: 49 private:
48 SkBitmap fBitmap; 50 SkBitmap fBitmap;
49 const int fSampleCountForNewSurfaces; // 0 if we don't know 51 const int fSampleCountForNewSurfaces; // 0 if we don't know
50 SkSurface::Budgeted fBudgeted; 52 SkSurface::Budgeted fBudgeted;
51 53
52 typedef SkImage_Base INHERITED; 54 typedef SkImage_Base INHERITED;
53 }; 55 };
54 56
55 #endif 57 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698