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

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

Issue 1836013002: Remove the GrGLInterface callback mechanism. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 | « include/gpu/gl/GrGLInterface.h ('k') | src/gpu/gl/GrGLUtil.h » ('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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "gl/GrGLInterface.h" 9 #include "gl/GrGLInterface.h"
10 #include "gl/GrGLExtensions.h" 10 #include "gl/GrGLExtensions.h"
11 #include "gl/GrGLUtil.h" 11 #include "gl/GrGLUtil.h"
12 12
13 #include <stdio.h> 13 #include <stdio.h>
14 14
15 #if GR_GL_PER_GL_FUNC_CALLBACK
16 namespace {
17 void GrGLDefaultInterfaceCallback(const GrGLInterface*) {}
18 }
19 #endif
20
21 const GrGLInterface* GrGLInterfaceAddTestDebugMarker(const GrGLInterface* interf ace, 15 const GrGLInterface* GrGLInterfaceAddTestDebugMarker(const GrGLInterface* interf ace,
22 GrGLInsertEventMarkerProc i nsertEventMarkerFn, 16 GrGLInsertEventMarkerProc i nsertEventMarkerFn,
23 GrGLPushGroupMarkerProc pus hGroupMarkerFn, 17 GrGLPushGroupMarkerProc pus hGroupMarkerFn,
24 GrGLPopGroupMarkerProc popG roupMarkerFn) { 18 GrGLPopGroupMarkerProc popG roupMarkerFn) {
25 GrGLInterface* newInterface = GrGLInterface::NewClone(interface); 19 GrGLInterface* newInterface = GrGLInterface::NewClone(interface);
26 20
27 if (!newInterface->fExtensions.has("GL_EXT_debug_marker")) { 21 if (!newInterface->fExtensions.has("GL_EXT_debug_marker")) {
28 newInterface->fExtensions.add("GL_EXT_debug_marker"); 22 newInterface->fExtensions.add("GL_EXT_debug_marker");
29 } 23 }
30 24
(...skipping 30 matching lines...) Expand all
61 newInterface->fFunctions.fStencilThenCoverStrokePath = nullptr; 55 newInterface->fFunctions.fStencilThenCoverStrokePath = nullptr;
62 newInterface->fFunctions.fStencilThenCoverFillPathInstanced = nullptr; 56 newInterface->fFunctions.fStencilThenCoverFillPathInstanced = nullptr;
63 newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = nullptr; 57 newInterface->fFunctions.fStencilThenCoverStrokePathInstanced = nullptr;
64 newInterface->fFunctions.fProgramPathFragmentInputGen = nullptr; 58 newInterface->fFunctions.fProgramPathFragmentInputGen = nullptr;
65 newInterface->fFunctions.fBindFragmentInputLocation = nullptr; 59 newInterface->fFunctions.fBindFragmentInputLocation = nullptr;
66 return newInterface; 60 return newInterface;
67 } 61 }
68 62
69 GrGLInterface::GrGLInterface() { 63 GrGLInterface::GrGLInterface() {
70 fStandard = kNone_GrGLStandard; 64 fStandard = kNone_GrGLStandard;
71
72 #if GR_GL_PER_GL_FUNC_CALLBACK
73 fCallback = GrGLDefaultInterfaceCallback;
74 fCallbackData = 0;
75 #endif
76 } 65 }
77 66
78 GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) { 67 GrGLInterface* GrGLInterface::NewClone(const GrGLInterface* interface) {
79 SkASSERT(interface); 68 SkASSERT(interface);
80 69
81 GrGLInterface* clone = new GrGLInterface; 70 GrGLInterface* clone = new GrGLInterface;
82 clone->fStandard = interface->fStandard; 71 clone->fStandard = interface->fStandard;
83 clone->fExtensions = interface->fExtensions; 72 clone->fExtensions = interface->fExtensions;
84 clone->fFunctions = interface->fFunctions; 73 clone->fFunctions = interface->fFunctions;
85 #if GR_GL_PER_GL_FUNC_CALLBACK
86 clone->fCallback = interface->fCallback;
87 clone->fCallbackData = interface->fCallbackData;
88 #endif
89 return clone; 74 return clone;
90 } 75 }
91 76
92 #ifdef SK_DEBUG 77 #ifdef SK_DEBUG
93 static int kIsDebug = 1; 78 static int kIsDebug = 1;
94 #else 79 #else
95 static int kIsDebug = 0; 80 static int kIsDebug = 0;
96 #endif 81 #endif
97 82
98 #define RETURN_FALSE_INTERFACE \ 83 #define RETURN_FALSE_INTERFACE \
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 779
795 if (fExtensions.has("EGL_KHR_image") || fExtensions.has("EGL_KHR_image_base" )) { 780 if (fExtensions.has("EGL_KHR_image") || fExtensions.has("EGL_KHR_image_base" )) {
796 if (nullptr == fFunctions.fEGLCreateImage || 781 if (nullptr == fFunctions.fEGLCreateImage ||
797 nullptr == fFunctions.fEGLDestroyImage) { 782 nullptr == fFunctions.fEGLDestroyImage) {
798 RETURN_FALSE_INTERFACE 783 RETURN_FALSE_INTERFACE
799 } 784 }
800 } 785 }
801 786
802 return true; 787 return true;
803 } 788 }
OLDNEW
« no previous file with comments | « include/gpu/gl/GrGLInterface.h ('k') | src/gpu/gl/GrGLUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698