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

Side by Side Diff: src/gpu/gl/GrGLStencilAttachment.h

Issue 1083133002: Rename GrStencilBuffer to GrStencilAttachment (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Align data member Created 5 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/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLStencilAttachment.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 2011 Google Inc. 2 * Copyright 2011 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 8
9 #ifndef GrGLStencilBuffer_DEFINED 9 #ifndef GrGLStencilAttachment_DEFINED
10 #define GrGLStencilBuffer_DEFINED 10 #define GrGLStencilAttachment_DEFINED
11 11
12 #include "gl/GrGLInterface.h" 12 #include "gl/GrGLInterface.h"
13 #include "GrStencilBuffer.h" 13 #include "GrStencilAttachment.h"
14 14
15 class GrGLStencilBuffer : public GrStencilBuffer { 15 class GrGLStencilAttachment : public GrStencilAttachment {
16 public: 16 public:
17 static const GrGLenum kUnknownInternalFormat = ~0U; 17 static const GrGLenum kUnknownInternalFormat = ~0U;
18 static const GrGLuint kUnknownBitCount = ~0U; 18 static const GrGLuint kUnknownBitCount = ~0U;
19 struct Format { 19 struct Format {
20 GrGLenum fInternalFormat; 20 GrGLenum fInternalFormat;
21 GrGLuint fStencilBits; 21 GrGLuint fStencilBits;
22 GrGLuint fTotalBits; 22 GrGLuint fTotalBits;
23 bool fPacked; 23 bool fPacked;
24 }; 24 };
25 25
26 struct IDDesc { 26 struct IDDesc {
27 IDDesc() : fRenderbufferID(0), fLifeCycle(kCached_LifeCycle) {} 27 IDDesc() : fRenderbufferID(0), fLifeCycle(kCached_LifeCycle) {}
28 GrGLuint fRenderbufferID; 28 GrGLuint fRenderbufferID;
29 GrGpuResource::LifeCycle fLifeCycle; 29 GrGpuResource::LifeCycle fLifeCycle;
30 }; 30 };
31 31
32 GrGLStencilBuffer(GrGpu* gpu, 32 GrGLStencilAttachment(GrGpu* gpu,
33 const IDDesc& idDesc, 33 const IDDesc& idDesc,
34 int width, int height, 34 int width, int height,
35 int sampleCnt, 35 int sampleCnt,
36 const Format& format) 36 const Format& format)
37 : GrStencilBuffer(gpu, idDesc.fLifeCycle, width, height, format.fStencil Bits, sampleCnt) 37 : GrStencilAttachment(gpu, idDesc.fLifeCycle, width, height, format.fSte ncilBits, sampleCnt)
38 , fFormat(format) 38 , fFormat(format)
39 , fRenderbufferID(idDesc.fRenderbufferID) { 39 , fRenderbufferID(idDesc.fRenderbufferID) {
40 this->registerWithCache(); 40 this->registerWithCache();
41 } 41 }
42 42
43 GrGLuint renderbufferID() const { 43 GrGLuint renderbufferID() const {
44 return fRenderbufferID; 44 return fRenderbufferID;
45 } 45 }
46 46
47 const Format& format() const { return fFormat; } 47 const Format& format() const { return fFormat; }
48 48
49 protected: 49 protected:
50 // overrides of GrResource 50 // overrides of GrResource
51 void onRelease() override; 51 void onRelease() override;
52 void onAbandon() override; 52 void onAbandon() override;
53 53
54 private: 54 private:
55 size_t onGpuMemorySize() const override; 55 size_t onGpuMemorySize() const override;
56 56
57 Format fFormat; 57 Format fFormat;
58 // may be zero for external SBs associated with external RTs 58 // may be zero for external SBs associated with external RTs
59 // (we don't require the client to give us the id, just tell 59 // (we don't require the client to give us the id, just tell
60 // us how many bits of stencil there are). 60 // us how many bits of stencil there are).
61 GrGLuint fRenderbufferID; 61 GrGLuint fRenderbufferID;
62 62
63 typedef GrStencilBuffer INHERITED; 63 typedef GrStencilAttachment INHERITED;
64 }; 64 };
65 65
66 #endif 66 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLStencilAttachment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698