http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrContext.h File gpu/include/GrContext.h (left): http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrContext.h#oldco... gpu/include/GrContext.h:582: void printStats() const; I may be obvious, but... /** * Why does this return a resource, when its given a stencilbuffer? */ http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrContext.h File gpu/include/GrContext.h (right): http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrContext.h#newco... gpu/include/GrContext.h:584: GrResourceEntry* addAndLockStencilBuffer(GrStencilBuffer* sb); /** * Are width/height/sampleCnt exact, or minimums? * Why does this return a stencilbuffer, while add (above) returns a resource? */ http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrContext.h#newco... gpu/include/GrContext.h:586: int sampleCnt); /** * Why does this take a resource instead of a stencilbuffer? */ http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrRenderTarget.h File gpu/include/GrRenderTarget.h (right): http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrRenderTarget.h#... gpu/include/GrRenderTarget.h:197: GrTexture* fTexture; // not ref'ed We have a lot (now) of width,height,allocatedWidth,allocatedHeight Does that group deserve a class/struct? Just a thought. http://codereview.appspot.com/4854044/diff/1001/gpu/src/GrGLStencilBuffer.h File gpu/src/GrGLStencilBuffer.h (left): http://codereview.appspot.com/4854044/diff/1001/gpu/src/GrGLStencilBuffer.h#o... gpu/src/GrGLStencilBuffer.h:39: return this->width() * this->height() * fFormat.fTotalBits; Do we need to catch/notice overflow here? Use 64bit intermediate?
On 2011/08/08 14:25:11, reed1 wrote: > http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrContext.h > File gpu/include/GrContext.h (left): > > http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrContext.h#oldco... > gpu/include/GrContext.h:582: void printStats() const; > I may be obvious, but... > > /** > * Why does this return a resource, when its given a stencilbuffer? > */ > > http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrContext.h > File gpu/include/GrContext.h (right): > > http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrContext.h#newco... > gpu/include/GrContext.h:584: GrResourceEntry* > addAndLockStencilBuffer(GrStencilBuffer* sb); > /** > * Are width/height/sampleCnt exact, or minimums? > * Why does this return a stencilbuffer, while add (above) returns a resource? > */ > > http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrContext.h#newco... > gpu/include/GrContext.h:586: int sampleCnt); > /** > * Why does this take a resource instead of a stencilbuffer? > */ > I added some short comments on how these GrContext functions are used. > > http://codereview.appspot.com/4854044/diff/1001/gpu/include/GrRenderTarget.h#... > gpu/include/GrRenderTarget.h:197: GrTexture* fTexture; // not ref'ed > We have a lot (now) of > > width,height,allocatedWidth,allocatedHeight > > Does that group deserve a class/struct? Just a thought. Perhaps. I'd like to get rid of this in the future and just have allocated width (maybe rename width). A separate class, maybe "GrTextureView", would refer to a subrect of GrTexture. > > http://codereview.appspot.com/4854044/diff/1001/gpu/src/GrGLStencilBuffer.h#o... > gpu/src/GrGLStencilBuffer.h:39: return this->width() * this->height() * > fFormat.fTotalBits; > Do we need to catch/notice overflow here? Use 64bit intermediate? I guess when we get to 16K by 16K 8bit surfaces we'll hit the signed int limit. I updated sizeInBytes to use size_t.
LGTM
On 2011/08/08 15:15:46, reed1 wrote: > LGTM Checked in at r2061.