Give GrDrawTarget a back ptr to its owning GrContext.
Review URL: https://codereview.appspot.com/7395055
git-svn-id: http://skia.googlecode.com/svn/trunk@7850 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 7fc2c13..2c2d949 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -82,7 +82,11 @@
#define DEBUG_INVAL_BUFFER 0xdeadcafe
#define DEBUG_INVAL_START_IDX -1
-GrDrawTarget::GrDrawTarget() : fClip(NULL) {
+GrDrawTarget::GrDrawTarget(GrContext* context)
+ : fClip(NULL)
+ , fContext(context) {
+ GrAssert(NULL != context);
+
fDrawState = &fDefaultDrawState;
// We assume that fDrawState always owns a ref to the object it points at.
fDefaultDrawState.ref();