Remove SWAP_PER_DRAW from GrGLGpu

This debug option was added back in 2011, and the code inside the
#define has not been compilable for many years.

Change-Id: I4366025da6e616f17f75dee14bced2809a90628f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273038
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2020-02-24 10:40:35 -07:00 committed by Skia Commit-Bot
parent 659cc1c907
commit 4c20318e48

View File

@ -2338,28 +2338,6 @@ void GrGLGpu::flushViewport(int width, int height) {
}
}
#define SWAP_PER_DRAW 0
#if SWAP_PER_DRAW
#if defined(SK_BUILD_FOR_MAC)
#include <AGL/agl.h>
#elif defined(SK_BUILD_FOR_WIN)
#include <gl/GL.h>
void SwapBuf() {
DWORD procID = GetCurrentProcessId();
HWND hwnd = GetTopWindow(GetDesktopWindow());
while(hwnd) {
DWORD wndProcID = 0;
GetWindowThreadProcessId(hwnd, &wndProcID);
if(wndProcID == procID) {
SwapBuffers(GetDC(hwnd));
}
hwnd = GetNextWindow(hwnd, GW_HWNDNEXT);
}
}
#endif
#endif
void GrGLGpu::drawMesh(GrRenderTarget* renderTarget, GrPrimitiveType primitiveType,
const GrMesh& mesh) {
if (this->glCaps().requiresCullFaceEnableDisableWhenDrawingLinesAfterNonLines() &&
@ -2370,19 +2348,6 @@ void GrGLGpu::drawMesh(GrRenderTarget* renderTarget, GrPrimitiveType primitiveTy
mesh.sendToGpu(primitiveType, this);
fLastPrimitiveType = primitiveType;
#if SWAP_PER_DRAW
glFlush();
#if defined(SK_BUILD_FOR_MAC)
aglSwapBuffers(aglGetCurrentContext());
int set_a_break_pt_here = 9;
aglSwapBuffers(aglGetCurrentContext());
#elif defined(SK_BUILD_FOR_WIN)
SwapBuf();
int set_a_break_pt_here = 9;
SwapBuf();
#endif
#endif
}
static GrGLenum gr_primitive_type_to_gl_mode(GrPrimitiveType primitiveType) {