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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 break; } | 330 break; } |
331 default: | 331 default: |
332 SkFAIL("Unexpected pname to GetBufferParamateriv"); | 332 SkFAIL("Unexpected pname to GetBufferParamateriv"); |
333 break; | 333 break; |
334 } | 334 } |
335 }; | 335 }; |
336 | 336 |
337 class NullInterface : public GrGLInterface { | 337 class NullInterface : public GrGLInterface { |
338 public: | 338 public: |
339 NullInterface(State* state) : fState(SkRef(state)) {} | 339 NullInterface(State* state) : fState(SkRef(state)) {} |
340 ~NullInterface() SK_OVERRIDE { | 340 ~NullInterface() override { |
341 fState->unref(); | 341 fState->unref(); |
342 } | 342 } |
343 State* fState; | 343 State* fState; |
344 }; | 344 }; |
345 | 345 |
346 } // end anonymous namespace | 346 } // end anonymous namespace |
347 | 347 |
348 static GrGLInterface* create_null_interface(State* state) { | 348 static GrGLInterface* create_null_interface(State* state) { |
349 GrGLInterface* interface = SkNEW_ARGS(NullInterface, (state)); | 349 GrGLInterface* interface = SkNEW_ARGS(NullInterface, (state)); |
350 | 350 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 interface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(fStat
e); | 549 interface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(fStat
e); |
550 #endif | 550 #endif |
551 } | 551 } |
552 | 552 |
553 SkNullGLContext::~SkNullGLContext() { | 553 SkNullGLContext::~SkNullGLContext() { |
554 fGL.reset(NULL); | 554 fGL.reset(NULL); |
555 fState->unref(); | 555 fState->unref(); |
556 } | 556 } |
557 | 557 |
558 void SkNullGLContext::makeCurrent() const { set_current_context(fState); } | 558 void SkNullGLContext::makeCurrent() const { set_current_context(fState); } |
OLD | NEW |