Fix sb/rt size computation
Review URL: http://codereview.appspot.com/4809087/ git-svn-id: http://skia.googlecode.com/svn/trunk@2079 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
ab15d618ae
commit
f6ff4951f7
@ -37,10 +37,11 @@ public:
|
||||
}
|
||||
|
||||
virtual size_t sizeInBytes() const {
|
||||
return (size_t) this->width() *
|
||||
this->height() *
|
||||
fFormat.fTotalBits *
|
||||
GrMax(1,this->numSamples());
|
||||
uint64_t size = this->width();
|
||||
size *= this->height();
|
||||
size *= fFormat.fTotalBits;
|
||||
size *= GrMax(1,this->numSamples());
|
||||
return (size_t)(size / 8);
|
||||
}
|
||||
|
||||
GrGLuint renderbufferID() const {
|
||||
|
@ -31,10 +31,11 @@ size_t GrRenderTarget::sizeInBytes() const {
|
||||
} else {
|
||||
colorBits = GrBytesPerPixel(fConfig);
|
||||
}
|
||||
return (size_t) fAllocatedWidth *
|
||||
fAllocatedHeight *
|
||||
colorBits *
|
||||
GrMax(1,fSampleCnt);
|
||||
uint64_t size = fAllocatedWidth;
|
||||
size *= fAllocatedHeight;
|
||||
size *= colorBits;
|
||||
size *= GrMax(1,fSampleCnt);
|
||||
return (size_t)(size / 8);
|
||||
}
|
||||
|
||||
void GrRenderTarget::flagAsNeedingResolve(const GrIRect* rect) {
|
||||
@ -71,4 +72,4 @@ void GrRenderTarget::setStencilBuffer(GrStencilBuffer* stencilBuffer) {
|
||||
fStencilBuffer->wasAttachedToRenderTarget(this);
|
||||
fStencilBuffer->ref();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user