Index: src/gpu/GrContext.cpp |
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
index f4ca6c480e16e51177e4495bba6477b98a29bbec..3ed0b6baa26fc37c9483c44b0fa9b30aee85dd7b 100755 |
--- a/src/gpu/GrContext.cpp |
+++ b/src/gpu/GrContext.cpp |
@@ -15,6 +15,7 @@ |
#include "GrBatchTarget.h" |
#include "GrBatchTest.h" |
#include "GrCaps.h" |
+#include "GrContextOptions.h" |
#include "GrDefaultGeoProcFactory.h" |
#include "GrGpuResource.h" |
#include "GrGpuResourcePriv.h" |
@@ -70,16 +71,16 @@ private: |
GrContext* fContext; |
}; |
+GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext) { |
+ GrContextOptions defaultOptions; |
+ return Create(backend, backendContext, defaultOptions); |
+} |
+ |
GrContext* GrContext::Create(GrBackend backend, GrBackendContext backendContext, |
- const Options* opts) { |
- GrContext* context; |
- if (NULL == opts) { |
- context = SkNEW_ARGS(GrContext, (Options())); |
- } else { |
- context = SkNEW_ARGS(GrContext, (*opts)); |
- } |
+ const GrContextOptions& options) { |
+ GrContext* context = SkNEW(GrContext); |
- if (context->init(backend, backendContext)) { |
+ if (context->init(backend, backendContext, options)) { |
return context; |
} else { |
context->unref(); |
@@ -96,7 +97,7 @@ static int32_t next_id() { |
return id; |
} |
-GrContext::GrContext(const Options& opts) : fOptions(opts), fUniqueID(next_id()) { |
+GrContext::GrContext() : fUniqueID(next_id()) { |
fGpu = NULL; |
fResourceCache = NULL; |
fResourceProvider = NULL; |
@@ -110,10 +111,11 @@ GrContext::GrContext(const Options& opts) : fOptions(opts), fUniqueID(next_id()) |
fMaxTextureSizeOverride = 1 << 20; |
} |
-bool GrContext::init(GrBackend backend, GrBackendContext backendContext) { |
+bool GrContext::init(GrBackend backend, GrBackendContext backendContext, |
+ const GrContextOptions& options) { |
SkASSERT(NULL == fGpu); |
- fGpu = GrGpu::Create(backend, backendContext, this); |
+ fGpu = GrGpu::Create(backend, backendContext, options, this); |
if (NULL == fGpu) { |
return false; |
} |