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

Unified Diff: src/gpu/GrGpu.cpp

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrRenderTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index d7d4ae7fd481f29eca1b3806f007cc7c4bc539e0..88e2bb961e6b8dd336713d6ee5928cb50b8a1dab 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -16,7 +16,7 @@
#include "GrIndexBuffer.h"
#include "GrResourceCache.h"
#include "GrRenderTargetPriv.h"
-#include "GrStencilBuffer.h"
+#include "GrStencilAttachment.h"
#include "GrVertexBuffer.h"
////////////////////////////////////////////////////////////////////////////////
@@ -76,8 +76,8 @@ GrTexture* GrGpu::createTexture(const GrSurfaceDesc& desc, bool budgeted,
return tex;
}
-bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
- SkASSERT(NULL == rt->renderTargetPriv().getStencilBuffer());
+bool GrGpu::attachStencilAttachmentToRenderTarget(GrRenderTarget* rt) {
+ SkASSERT(NULL == rt->renderTargetPriv().getStencilAttachment());
GrUniqueKey sbKey;
int width = rt->width();
@@ -89,17 +89,17 @@ bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
}
#endif
- GrStencilBuffer::ComputeSharedStencilBufferKey(width, height, rt->numSamples(), &sbKey);
- SkAutoTUnref<GrStencilBuffer> sb(static_cast<GrStencilBuffer*>(
+ GrStencilAttachment::ComputeSharedStencilAttachmentKey(width, height, rt->numSamples(), &sbKey);
+ SkAutoTUnref<GrStencilAttachment> sb(static_cast<GrStencilAttachment*>(
this->getContext()->getResourceCache()->findAndRefUniqueResource(sbKey)));
if (sb) {
- if (this->attachStencilBufferToRenderTarget(sb, rt)) {
- rt->renderTargetPriv().didAttachStencilBuffer(sb);
+ if (this->attachStencilAttachmentToRenderTarget(sb, rt)) {
+ rt->renderTargetPriv().didAttachStencilAttachment(sb);
return true;
}
return false;
}
- if (this->createStencilBufferForRenderTarget(rt, width, height)) {
+ if (this->createStencilAttachmentForRenderTarget(rt, width, height)) {
// Right now we're clearing the stencil buffer here after it is
// attached to an RT for the first time. When we start matching
// stencil buffers with smaller color targets this will no longer
@@ -109,7 +109,7 @@ bool GrGpu::attachStencilBufferToRenderTarget(GrRenderTarget* rt) {
// FBO. But iOS doesn't allow a stencil-only FBO. It reports unsupported
// FBO status.
this->clearStencil(rt);
- GrStencilBuffer* sb = rt->renderTargetPriv().getStencilBuffer();
+ GrStencilAttachment* sb = rt->renderTargetPriv().getStencilAttachment();
sb->resourcePriv().setUniqueKey(sbKey);
return true;
} else {
@@ -125,7 +125,7 @@ GrTexture* GrGpu::wrapBackendTexture(const GrBackendTextureDesc& desc) {
}
// TODO: defer this and attach dynamically
GrRenderTarget* tgt = tex->asRenderTarget();
- if (tgt && !this->attachStencilBufferToRenderTarget(tgt)) {
+ if (tgt && !this->attachStencilAttachmentToRenderTarget(tgt)) {
tex->unref();
return NULL;
} else {
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrRenderTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698