aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-16 20:38:11 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-16 20:38:11 +0000
commit8b4a64d3184de8c0680fbacd3fd89279ac06fb52 (patch)
treec260185361fafef21c0b66992198c9e31ccd8e79 /gpu
parent498776ad9f5ac78f4a6d0a4ef967921c42bc3e3f (diff)
Make GrDrawTarget.h and GrPathRenderer.h be private headers
Review URL: http://codereview.appspot.com/4894050/ git-svn-id: http://skia.googlecode.com/svn/trunk@2125 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu')
-rw-r--r--gpu/include/GrContext.h8
-rw-r--r--gpu/src/GrContext.cpp13
-rw-r--r--gpu/src/GrDrawTarget.h (renamed from gpu/include/GrDrawTarget.h)0
-rw-r--r--gpu/src/GrGpu.cpp2
-rw-r--r--gpu/src/GrPathRenderer.h (renamed from gpu/include/GrPathRenderer.h)0
5 files changed, 15 insertions, 8 deletions
diff --git a/gpu/include/GrContext.h b/gpu/include/GrContext.h
index 06717011ae..44e0c041cc 100644
--- a/gpu/include/GrContext.h
+++ b/gpu/include/GrContext.h
@@ -12,16 +12,20 @@
#include "GrClip.h"
#include "GrPaint.h"
-#include "GrPathRenderer.h"
+class GrDefaultPathRenderer;
+class GrDrawTarget;
class GrFontCache;
class GrGpu;
struct GrGpuStats;
+class GrIndexBuffer;
class GrIndexBufferAllocPool;
class GrInOrderDrawBuffer;
+class GrPathRenderer;
class GrResourceEntry;
class GrResourceCache;
class GrStencilBuffer;
+class GrVertexBuffer;
class GrVertexBufferAllocPool;
@@ -551,7 +555,7 @@ private:
GrFontCache* fFontCache;
GrPathRenderer* fCustomPathRenderer;
- GrDefaultPathRenderer fDefaultPathRenderer;
+ GrDefaultPathRenderer* fDefaultPathRenderer;
GrVertexBufferAllocPool* fDrawBufferVBAllocPool;
GrIndexBufferAllocPool* fDrawBufferIBAllocPool;
diff --git a/gpu/src/GrContext.cpp b/gpu/src/GrContext.cpp
index d1de73496f..b3e902d798 100644
--- a/gpu/src/GrContext.cpp
+++ b/gpu/src/GrContext.cpp
@@ -61,6 +61,7 @@ GrContext::~GrContext() {
delete fDrawBuffer;
delete fDrawBufferVBAllocPool;
delete fDrawBufferIBAllocPool;
+ GrSafeUnref(fDefaultPathRenderer);
GrSafeUnref(fCustomPathRenderer);
GrSafeUnref(fAAFillRectIndexBuffer);
GrSafeUnref(fAAStrokeRectIndexBuffer);
@@ -1706,14 +1707,14 @@ void GrContext::printStats() const {
fGpu->printStats();
}
-GrContext::GrContext(GrGpu* gpu) :
- fDefaultPathRenderer(gpu->supportsTwoSidedStencil(),
- gpu->supportsStencilWrapOps()) {
-
+GrContext::GrContext(GrGpu* gpu) {
fGpu = gpu;
fGpu->ref();
fGpu->setContext(this);
+ fDefaultPathRenderer =
+ new GrDefaultPathRenderer(gpu->supportsTwoSidedStencil(),
+ gpu->supportsStencilWrapOps());
fCustomPathRenderer = GrPathRenderer::CreatePathRenderer();
fGpu->setClipPathRenderer(fCustomPathRenderer);
@@ -1785,8 +1786,8 @@ GrPathRenderer* GrContext::getPathRenderer(const GrPath& path,
fCustomPathRenderer->canDrawPath(path, fill)) {
return fCustomPathRenderer;
} else {
- GrAssert(fDefaultPathRenderer.canDrawPath(path, fill));
- return &fDefaultPathRenderer;
+ GrAssert(fDefaultPathRenderer->canDrawPath(path, fill));
+ return fDefaultPathRenderer;
}
}
diff --git a/gpu/include/GrDrawTarget.h b/gpu/src/GrDrawTarget.h
index 8196beb102..8196beb102 100644
--- a/gpu/include/GrDrawTarget.h
+++ b/gpu/src/GrDrawTarget.h
diff --git a/gpu/src/GrGpu.cpp b/gpu/src/GrGpu.cpp
index 53b5c03c97..cde851d49f 100644
--- a/gpu/src/GrGpu.cpp
+++ b/gpu/src/GrGpu.cpp
@@ -62,6 +62,8 @@ GrGpu::GrGpu()
GrGpu::~GrGpu() {
this->releaseResources();
+ GrSafeUnref(fDefaultPathRenderer);
+ GrSafeUnref(fClientPathRenderer);
}
void GrGpu::abandonResources() {
diff --git a/gpu/include/GrPathRenderer.h b/gpu/src/GrPathRenderer.h
index 67c3a93cb5..67c3a93cb5 100644
--- a/gpu/include/GrPathRenderer.h
+++ b/gpu/src/GrPathRenderer.h