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

Side by Side Diff: src/gpu/GrAtlas.h

Issue 24608002: First pass at font cache refactor: Create an atlas manager per texture (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Make sure to set the MaskFormat Created 7 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 | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 GrIPoint16 fPlot; 57 GrIPoint16 fPlot;
58 GrMaskFormat fMaskFormat; 58 GrMaskFormat fMaskFormat;
59 59
60 friend class GrAtlasMgr; 60 friend class GrAtlasMgr;
61 }; 61 };
62 62
63 class GrPlotMgr; 63 class GrPlotMgr;
64 64
65 class GrAtlasMgr { 65 class GrAtlasMgr {
66 public: 66 public:
67 GrAtlasMgr(GrGpu*); 67 GrAtlasMgr(GrGpu*, GrMaskFormat);
68 ~GrAtlasMgr(); 68 ~GrAtlasMgr();
69 69
70 GrAtlas* addToAtlas(GrAtlas**, int width, int height, const void*, 70 GrAtlas* addToAtlas(GrAtlas**, int width, int height, const void*, GrIPoint1 6*);
71 GrMaskFormat, GrIPoint16*);
72 void deleteAtlas(GrAtlas* atlas) { delete atlas; } 71 void deleteAtlas(GrAtlas* atlas) { delete atlas; }
73 72
74 GrTexture* getTexture(GrMaskFormat format) const { 73 GrTexture* getTexture() const {
75 SkASSERT((unsigned)format < kCount_GrMaskFormats); 74 return fTexture;
76 return fTexture[format];
77 } 75 }
78 76
79 // to be called by ~GrAtlas() 77 // to be called by ~GrAtlas()
80 void freePlot(GrMaskFormat format, int x, int y); 78 void freePlot(int x, int y);
81 79
82 private: 80 private:
83 GrGpu* fGpu; 81 GrGpu* fGpu;
84 GrTexture* fTexture[kCount_GrMaskFormats]; 82 GrMaskFormat fMaskFormat;
85 GrPlotMgr* fPlotMgr[kCount_GrMaskFormats]; 83 GrTexture* fTexture;
84 GrPlotMgr* fPlotMgr;
86 }; 85 };
87 86
88 #endif 87 #endif
OLDNEW
« include/gpu/GrTypes.h ('K') | « include/gpu/GrTypes.h ('k') | src/gpu/GrAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698