Turn clipping back on in OSAA pass 1. Skip default cons on GrDrawState when saving off a GrDrawTarget's state.
Review URL: http://codereview.appspot.com/5553051/
git-svn-id: http://skia.googlecode.com/svn/trunk@3067 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 5fc420d..6962a18 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -21,6 +21,7 @@
#include "GrTexture.h"
#include "SkXfermode.h"
+#include "SkTLazy.h"
class GrTexture;
class GrClipIterator;
@@ -139,7 +140,7 @@
*/
struct SavedDrawState {
private:
- GrDrawState fState;
+ SkTLazy<GrDrawState> fState;
friend class GrDrawTarget;
};
@@ -926,10 +927,12 @@
// Helpers for GrDrawTarget subclasses that won't have private access to
// SavedDrawState but need to peek at the state values.
- static GrDrawState& accessSavedDrawState(SavedDrawState& sds)
- { return sds.fState; }
- static const GrDrawState& accessSavedDrawState(const SavedDrawState& sds)
- { return sds.fState; }
+ static GrDrawState& accessSavedDrawState(SavedDrawState& sds) {
+ return *sds.fState.get();
+ }
+ static const GrDrawState& accessSavedDrawState(const SavedDrawState& sds){
+ return *sds.fState.get();
+ }
// implemented by subclass to allocate space for reserved geom
virtual bool onReserveVertexSpace(GrVertexLayout vertexLayout,