Roll out r3117 to alleviate http://code.google.com/p/skia/issues/detail?id=471 (...
authorepoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 31 Jan 2012 17:18:58 +0000 (17:18 +0000)
committerepoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 31 Jan 2012 17:18:58 +0000 (17:18 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@3122 2bbb7eff-a529-9590-31e7-b0007b416f81

src/gpu/GrGpu.cpp
src/gpu/GrGpu.h
src/gpu/GrGpuGL.cpp

index 5ec9948..39960de 100644 (file)
@@ -343,20 +343,15 @@ const GrVertexBuffer* GrGpu::getUnitSquareVertexBuffer() const {
 
 ////////////////////////////////////////////////////////////////////////////////
 
-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;
-}
+// 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;
 
 // mapping of clip-respecting stencil funcs to normal stencil funcs
 // mapping depends on whether stencil-clipping is in effect.
index 37d1fcf..e617efb 100644 (file)
@@ -355,7 +355,7 @@ protected:
 
     // stencil settings to clip drawing when stencil clipping is in effect
     // and the client isn't using the stencil test.
-    static const GrStencilSettings* GetClipStencilSettings(void);
+    static const GrStencilSettings& gClipStencilSettings;
 
     GrGpuStats fStats;
 
index df578c9..70d28d6 100644 (file)
@@ -1776,7 +1776,7 @@ void GrGpuGL::flushStencil() {
 
         if (settings->isDisabled()) {
             if (stencilClip) {
-                settings = GetClipStencilSettings();
+                settings = &gClipStencilSettings;
             }
         }