| OLD | NEW |
| 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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 if (!ctx->isValid()) { | 540 if (!ctx->isValid()) { |
| 541 SkDELETE(ctx); | 541 SkDELETE(ctx); |
| 542 return NULL; | 542 return NULL; |
| 543 } | 543 } |
| 544 return ctx; | 544 return ctx; |
| 545 } | 545 } |
| 546 | 546 |
| 547 SkNullGLContext::SkNullGLContext() { | 547 SkNullGLContext::SkNullGLContext() { |
| 548 fState = SkNEW(ContextState); | 548 fState = SkNEW(ContextState); |
| 549 GrGLInterface* interface = create_null_interface(fState); | 549 GrGLInterface* interface = create_null_interface(fState); |
| 550 fGL.reset(interface); | 550 this->init(interface); |
| 551 #if GR_GL_PER_GL_FUNC_CALLBACK | 551 #if GR_GL_PER_GL_FUNC_CALLBACK |
| 552 interface->fCallback = set_current_context_from_interface; | 552 interface->fCallback = set_current_context_from_interface; |
| 553 interface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(fStat
e); | 553 interface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(fStat
e); |
| 554 #endif | 554 #endif |
| 555 } | 555 } |
| 556 | 556 |
| 557 SkNullGLContext::~SkNullGLContext() { | 557 SkNullGLContext::~SkNullGLContext() { |
| 558 fGL.reset(NULL); | 558 this->teardown(); |
| 559 fState->unref(); | 559 fState->unref(); |
| 560 } | 560 } |
| 561 | 561 |
| 562 void SkNullGLContext::makeCurrent() const { set_current_context(fState); } | 562 void SkNullGLContext::onPlatformMakeCurrent() const { set_current_context(fState
); } |
| OLD | NEW |