Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: src/gpu/GrContext.cpp

Issue 1151603005: Revert of Store context options on caps. (Closed) Base URL: https://skia.googlesource.com/skia.git@onecaps
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrTypesPriv.h ('k') | src/gpu/GrContextFactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 3ed0b6baa26fc37c9483c44b0fa9b30aee85dd7b..f4ca6c480e16e51177e4495bba6477b98a29bbec 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 @@
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);
-
- if (context->init(backend, backendContext, options)) {
+ const Options* opts) {
+ GrContext* context;
+ if (NULL == opts) {
+ context = SkNEW_ARGS(GrContext, (Options()));
+ } else {
+ context = SkNEW_ARGS(GrContext, (*opts));
+ }
+
+ if (context->init(backend, backendContext)) {
return context;
} else {
context->unref();
@@ -97,7 +96,7 @@
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 @@
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;
}
« no previous file with comments | « include/gpu/GrTypesPriv.h ('k') | src/gpu/GrContextFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698