Make the Sk GL context class an abstract base class
authorkkinnunen <kkinnunen@nvidia.com>
Thu, 9 Oct 2014 12:24:15 +0000 (05:24 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 9 Oct 2014 12:24:15 +0000 (05:24 -0700)
commit9e61bb7815b133bc40ea7b00fccc853f4b728e3c
treefb63fc7dbc1ede28f821af30fc0c6634e6e1168d
parent78c71272fb26852bf3d2ca31785e61d4a598af82
Make the Sk GL context class an abstract base class

Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before,
it depended on ifdefs to implement the platform dependent polymorphism.  Move
the logic to subclasses of the various platform implementations.

This a step to enable Skia embedders to compile dm and bench_pictures. The
concrete goal is to support running these test apps with Chromium command buffer.

With this change, Chromium can implement its own version of SkGLNativeContext
that uses command buffer, and host the implementation in its own repository.

Implements the above by renaming the SkGLContextHelper to SkGLContext and
removing the unneeded SkGLNativeContext. Also removes
SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused:
no use in Skia code, and no tests.

BUG=skia:2992

Committed: https://skia.googlesource.com/skia/+/a90ed4e83897b45d6331ee4c54e1edd4054de9a8

Review URL: https://codereview.chromium.org/630843002
36 files changed:
bench/nanobench.cpp
gyp/gpu.gypi
gyp/public_headers.gypi
include/gpu/GrContextFactory.h
include/gpu/gl/SkANGLEGLContext.h
include/gpu/gl/SkDebugGLContext.h
include/gpu/gl/SkGLContext.h [new file with mode: 0644]
include/gpu/gl/SkGLContextHelper.h [deleted file]
include/gpu/gl/SkMesaGLContext.h
include/gpu/gl/SkNativeGLContext.h [deleted file]
include/gpu/gl/SkNullGLContext.h
src/gpu/gl/SkGLContext.cpp [new file with mode: 0644]
src/gpu/gl/SkGLContextHelper.cpp [deleted file]
src/gpu/gl/angle/SkANGLEGLContext.cpp
src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp [new file with mode: 0644]
src/gpu/gl/egl/SkNativeGLContext_egl.cpp [deleted file]
src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp [new file with mode: 0644]
src/gpu/gl/glx/SkNativeGLContext_glx.cpp [deleted file]
src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm [new file with mode: 0644]
src/gpu/gl/iOS/SkNativeGLContext_iOS.mm [deleted file]
src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp [new file with mode: 0644]
src/gpu/gl/mac/SkNativeGLContext_mac.cpp [deleted file]
src/gpu/gl/mesa/SkMesaGLContext.cpp
src/gpu/gl/nacl/SkCreatePlatformGLContext_nacl.cpp [new file with mode: 0644]
src/gpu/gl/nacl/SkNativeGLContext_nacl.cpp [deleted file]
src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp [new file with mode: 0644]
src/gpu/gl/win/SkNativeGLContext_win.cpp [deleted file]
tests/GLInterfaceValidationTest.cpp
tests/Test.cpp
tools/PictureRenderer.cpp
tools/PictureRenderer.h
tools/timer/GpuTimer.cpp
tools/timer/GpuTimer.h
tools/timer/Timer.cpp
tools/timer/Timer.h