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

Side by Side Diff: tools/gpu/gl/debug/GrFBBindableObj.h

Issue 2085043002: Support GL_SAMPLES queries in null contexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 6 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 | « tools/gpu/gl/debug/DebugGLTestContext.cpp ('k') | tools/gpu/gl/debug/GrRenderBufferObj.h » ('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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 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 #ifndef GrFBBindableObj_DEFINED 9 #ifndef GrFBBindableObj_DEFINED
10 #define GrFBBindableObj_DEFINED 10 #define GrFBBindableObj_DEFINED
11 11
12 #include "SkTDArray.h" 12 #include "SkTDArray.h"
13 #include "GrFakeRefObj.h" 13 #include "GrFakeRefObj.h"
14 14
15 //////////////////////////////////////////////////////////////////////////////// 15 ////////////////////////////////////////////////////////////////////////////////
16 // A common base class for render buffers and textures 16 // A common base class for render buffers and textures
17 class GrFBBindableObj : public GrFakeRefObj { 17 class GrFBBindableObj : public GrFakeRefObj {
18 18
19 public: 19 public:
20 GrFBBindableObj() 20 GrFBBindableObj()
21 : GrFakeRefObj() { 21 : GrFakeRefObj()
22 , fNumSamples(1) {
22 } 23 }
23 24
24 virtual ~GrFBBindableObj() { 25 virtual ~GrFBBindableObj() {
25 GrAlwaysAssert(0 == fColorReferees.count()); 26 GrAlwaysAssert(0 == fColorReferees.count());
26 GrAlwaysAssert(0 == fDepthReferees.count()); 27 GrAlwaysAssert(0 == fDepthReferees.count());
27 GrAlwaysAssert(0 == fStencilReferees.count()); 28 GrAlwaysAssert(0 == fStencilReferees.count());
28 } 29 }
29 30
30 void setColorBound(GrFakeRefObj *referee) { 31 void setColorBound(GrFakeRefObj *referee) {
31 fColorReferees.append(1, &referee); 32 fColorReferees.append(1, &referee);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 fStencilReferees.removeShuffle(index); 69 fStencilReferees.removeShuffle(index);
69 } 70 }
70 bool getStencilBound(GrFakeRefObj *referee) const { 71 bool getStencilBound(GrFakeRefObj *referee) const {
71 int index = fStencilReferees.find(referee); 72 int index = fStencilReferees.find(referee);
72 return 0 <= index; 73 return 0 <= index;
73 } 74 }
74 bool getStencilBound() const { 75 bool getStencilBound() const {
75 return 0 != fStencilReferees.count(); 76 return 0 != fStencilReferees.count();
76 } 77 }
77 78
79 int numSamples() { return fNumSamples; }
78 80
79 protected: 81 protected:
82 int fNumSamples;
83
80 private: 84 private:
81 SkTDArray<GrFakeRefObj *> fColorReferees; // frame buffers that use this a s a color buffer (via "glFramebufferRenderbuffer" or "glFramebufferTexture2D") 85 SkTDArray<GrFakeRefObj *> fColorReferees; // frame buffers that use this a s a color buffer (via "glFramebufferRenderbuffer" or "glFramebufferTexture2D")
82 SkTDArray<GrFakeRefObj *> fDepthReferees; // frame buffers that use this a s a depth buffer (via "glFramebufferRenderbuffer" or "glFramebufferTexture2D") 86 SkTDArray<GrFakeRefObj *> fDepthReferees; // frame buffers that use this a s a depth buffer (via "glFramebufferRenderbuffer" or "glFramebufferTexture2D")
83 SkTDArray<GrFakeRefObj *> fStencilReferees; // frame buffers that use this a s a stencil buffer (via "glFramebufferRenderbuffer" or "glFramebufferTexture2D") 87 SkTDArray<GrFakeRefObj *> fStencilReferees; // frame buffers that use this a s a stencil buffer (via "glFramebufferRenderbuffer" or "glFramebufferTexture2D")
84 88
85 typedef GrFakeRefObj INHERITED; 89 typedef GrFakeRefObj INHERITED;
86 }; 90 };
87 91
88 #endif // GrFBBindableObj_DEFINED 92 #endif // GrFBBindableObj_DEFINED
OLDNEW
« no previous file with comments | « tools/gpu/gl/debug/DebugGLTestContext.cpp ('k') | tools/gpu/gl/debug/GrRenderBufferObj.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698