diff options
author | 2012-01-31 15:16:10 +0000 | |
---|---|---|
committer | 2012-01-31 15:16:10 +0000 | |
commit | c943bd5984df80a1e138c7ae81515620ce8a68e3 (patch) | |
tree | a27d3849c107077e83de43e7bdb540d32914f8ca /src/gpu/GrGpu.cpp | |
parent | c1ea60a9ea63fc590f11f49cd0d744e061891985 (diff) |
Remove one static initializer in src/gpu/GrGpu.cpp
Review URL: https://codereview.appspot.com/5504073
git-svn-id: http://skia.googlecode.com/svn/trunk@3117 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r-- | src/gpu/GrGpu.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index 39960de054..5ec9948690 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -343,15 +343,20 @@ const GrVertexBuffer* GrGpu::getUnitSquareVertexBuffer() const { //////////////////////////////////////////////////////////////////////////////// -// stencil settings to use when clip is in stencil -GR_STATIC_CONST_SAME_STENCIL(gClipStencilSettings, - kKeep_StencilOp, - kKeep_StencilOp, - kAlwaysIfInClip_StencilFunc, - 0x0000, - 0x0000, - 0x0000); -const GrStencilSettings& GrGpu::gClipStencilSettings = ::gClipStencilSettings; +const GrStencilSettings* GrGpu::GetClipStencilSettings(void) { + // stencil settings to use when clip is in stencil + // NOTE: This is thread-safe on Windows because the implementation of + // GR_STATIC_CONST_SAME_STENCIL simply updates a pointer to an already + // constructed constant structure. + GR_STATIC_CONST_SAME_STENCIL(sClipStencilSettings, + kKeep_StencilOp, + kKeep_StencilOp, + kAlwaysIfInClip_StencilFunc, + 0x0000, + 0x0000, + 0x0000); + return &sClipStencilSettings; +} // mapping of clip-respecting stencil funcs to normal stencil funcs // mapping depends on whether stencil-clipping is in effect. |