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

Side by Side Diff: src/gpu/gl/SkNullGLContext.cpp

Issue 1490113005: Add config options to run different GPU APIs to dm and nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-03-context-factory-glcontext-type
Patch Set: Created 4 years, 12 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | src/gpu/gl/angle/SkANGLEGLContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "gl/SkNullGLContext.h" 9 #include "gl/SkNullGLContext.h"
10 #include "gl/GrGLInterface.h" 10 #include "gl/GrGLInterface.h"
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 state->ref(); 571 state->ref();
572 } 572 }
573 } 573 }
574 574
575 #if GR_GL_PER_GL_FUNC_CALLBACK 575 #if GR_GL_PER_GL_FUNC_CALLBACK
576 static void set_current_context_from_interface(const GrGLInterface* interface) { 576 static void set_current_context_from_interface(const GrGLInterface* interface) {
577 set_current_context(reinterpret_cast<State*>(interface->fCallbackData)); 577 set_current_context(reinterpret_cast<State*>(interface->fCallbackData));
578 } 578 }
579 #endif 579 #endif
580 580
581 SkNullGLContext* SkNullGLContext::Create(GrGLStandard forcedGpuAPI) { 581 SkNullGLContext* SkNullGLContext::Create() {
582 if (kGLES_GrGLStandard == forcedGpuAPI) {
583 return nullptr;
584 }
585 SkNullGLContext* ctx = new SkNullGLContext; 582 SkNullGLContext* ctx = new SkNullGLContext;
586 if (!ctx->isValid()) { 583 if (!ctx->isValid()) {
587 delete ctx; 584 delete ctx;
588 return nullptr; 585 return nullptr;
589 } 586 }
590 return ctx; 587 return ctx;
591 } 588 }
592 589
593 SkNullGLContext::SkNullGLContext() { 590 SkNullGLContext::SkNullGLContext() {
594 fState = new ContextState; 591 fState = new ContextState;
595 GrGLInterface* interface = create_null_interface(fState); 592 GrGLInterface* interface = create_null_interface(fState);
596 this->init(interface); 593 this->init(interface);
597 #if GR_GL_PER_GL_FUNC_CALLBACK 594 #if GR_GL_PER_GL_FUNC_CALLBACK
598 interface->fCallback = set_current_context_from_interface; 595 interface->fCallback = set_current_context_from_interface;
599 interface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(fStat e); 596 interface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(fStat e);
600 #endif 597 #endif
601 } 598 }
602 599
603 SkNullGLContext::~SkNullGLContext() { 600 SkNullGLContext::~SkNullGLContext() {
604 this->teardown(); 601 this->teardown();
605 fState->unref(); 602 fState->unref();
606 } 603 }
607 604
608 void SkNullGLContext::onPlatformMakeCurrent() const { set_current_context(fState ); } 605 void SkNullGLContext::onPlatformMakeCurrent() const { set_current_context(fState ); }
OLDNEW
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | src/gpu/gl/angle/SkANGLEGLContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698