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

Unified Diff: tools/viewer/sk_app/mac/GLWindowContext_mac.cpp

Issue 2167503002: Stub in Mac viewer code. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Exclude Mac files from other Viewer builds Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/viewer/sk_app/mac/GLWindowContext_mac.h ('k') | tools/viewer/sk_app/mac/Window_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/mac/GLWindowContext_mac.cpp
diff --git a/tools/viewer/sk_app/unix/GLWindowContext_unix.cpp b/tools/viewer/sk_app/mac/GLWindowContext_mac.cpp
similarity index 73%
copy from tools/viewer/sk_app/unix/GLWindowContext_unix.cpp
copy to tools/viewer/sk_app/mac/GLWindowContext_mac.cpp
index cde1eb2b5c615cbcae2186340585840b074c55ff..aa700e31656ecb12bdac283711bd77c39f7191ae 100644
--- a/tools/viewer/sk_app/unix/GLWindowContext_unix.cpp
+++ b/tools/viewer/sk_app/mac/GLWindowContext_mac.cpp
@@ -6,17 +6,17 @@
* found in the LICENSE file.
*/
-#include "GLWindowContext_unix.h"
+#include "GLWindowContext_mac.h"
-#include <GL/gl.h>
+//#include <GL/gl.h>
-#include "Window_unix.h"
+#include "Window_mac.h"
namespace sk_app {
// platform-dependent create
GLWindowContext* GLWindowContext::Create(void* platformData, const DisplayParams& params) {
- GLWindowContext_unix* ctx = new GLWindowContext_unix(platformData, params);
+ GLWindowContext_mac* ctx = new GLWindowContext_mac(platformData, params);
if (!ctx->isValid()) {
delete ctx;
return nullptr;
@@ -24,24 +24,30 @@ GLWindowContext* GLWindowContext::Create(void* platformData, const DisplayParams
return ctx;
}
-GLWindowContext_unix::GLWindowContext_unix(void* platformData, const DisplayParams& params)
+GLWindowContext_mac::GLWindowContext_mac(void* platformData, const DisplayParams& params)
: GLWindowContext(platformData, params)
+#if 0
+ // TODO: init Mac-specific OpenGL objects
, fDisplay(nullptr)
, fWindow(0)
- , fGLContext(0) {
+ , fGLContext(0)
+#endif
+ {
// any config code here (particularly for msaa)?
this->initializeContext(platformData, params);
}
-GLWindowContext_unix::~GLWindowContext_unix() {
+GLWindowContext_mac::~GLWindowContext_mac() {
this->destroyContext();
}
-void GLWindowContext_unix::onInitializeContext(void* platformData, const DisplayParams& params) {
- ContextPlatformData_unix* unixPlatformData =
- reinterpret_cast<ContextPlatformData_unix*>(platformData);
+void GLWindowContext_mac::onInitializeContext(void* platformData, const DisplayParams& params) {
+#if 0
+ // TODO: Init for Mac
+ ContextPlatformData_mac* unixPlatformData =
+ reinterpret_cast<ContextPlatformData_mac*>(platformData);
if (unixPlatformData) {
fDisplay = unixPlatformData->fDisplay;
@@ -76,22 +82,29 @@ void GLWindowContext_unix::onInitializeContext(void* platformData, const Display
(unsigned int*)&fWidth, (unsigned int*)&fHeight, &border_width, &depth);
glViewport(0, 0, fWidth, fHeight);
}
+#endif
}
-void GLWindowContext_unix::onDestroyContext() {
+void GLWindowContext_mac::onDestroyContext() {
+#if 0
+ // TODO: teardown for Mac
if (!fDisplay || !fGLContext) {
return;
}
glXMakeCurrent(fDisplay, None, nullptr);
glXDestroyContext(fDisplay, fGLContext);
fGLContext = nullptr;
+#endif
}
-void GLWindowContext_unix::onSwapBuffers() {
+void GLWindowContext_mac::onSwapBuffers() {
+#if 0
+ // TODO: swap for Mac
if (fDisplay && fGLContext) {
glXSwapBuffers(fDisplay, fWindow);
}
+#endif
}
« no previous file with comments | « tools/viewer/sk_app/mac/GLWindowContext_mac.h ('k') | tools/viewer/sk_app/mac/Window_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698