aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rwxr-xr-xsrc/gpu/GrContext.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 3ed0b6baa2..f4ca6c480e 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -15,7 +15,6 @@
#include "GrBatchTarget.h"
#include "GrBatchTest.h"
#include "GrCaps.h"
-#include "GrContextOptions.h"
#include "GrDefaultGeoProcFactory.h"
#include "GrGpuResource.h"
#include "GrGpuResourcePriv.h"
@@ -71,16 +70,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 GrContextOptions& options) {
- GrContext* context = SkNEW(GrContext);
+ const Options* opts) {
+ GrContext* context;
+ if (NULL == opts) {
+ context = SkNEW_ARGS(GrContext, (Options()));
+ } else {
+ context = SkNEW_ARGS(GrContext, (*opts));
+ }
- if (context->init(backend, backendContext, options)) {
+ if (context->init(backend, backendContext)) {
return context;
} else {
context->unref();
@@ -97,7 +96,7 @@ static int32_t next_id() {
return id;
}
-GrContext::GrContext() : fUniqueID(next_id()) {
+GrContext::GrContext(const Options& opts) : fOptions(opts), fUniqueID(next_id()) {
fGpu = NULL;
fResourceCache = NULL;
fResourceProvider = NULL;
@@ -111,11 +110,10 @@ GrContext::GrContext() : fUniqueID(next_id()) {
fMaxTextureSizeOverride = 1 << 20;
}
-bool GrContext::init(GrBackend backend, GrBackendContext backendContext,
- const GrContextOptions& options) {
+bool GrContext::init(GrBackend backend, GrBackendContext backendContext) {
SkASSERT(NULL == fGpu);
- fGpu = GrGpu::Create(backend, backendContext, options, this);
+ fGpu = GrGpu::Create(backend, backendContext, this);
if (NULL == fGpu) {
return false;
}