aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/mac
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-23 14:54:19 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-11-23 14:54:19 +0000
commit4ee8aea2a77d2d22d56afe68699179e5a02ac4f4 (patch)
tree70fb95a01cb3514909cfcfa633d505d3f71b61a6 /src/utils/mac
parent95b85bd1ba98141c9ec70a4593eaf4671347e472 (diff)
fix mac warnings
http://codereview.appspot.com/5431053/ M include/views/SkOSWindow_Mac.h M src/utils/mac/SkNSView.mm M src/utils/mac/SkNSView.h M src/utils/mac/SkOSWindow_Mac.mm M src/utils/mac/SkSampleNSView.h git-svn-id: http://skia.googlecode.com/svn/trunk@2740 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/utils/mac')
-rw-r--r--src/utils/mac/SkNSView.h4
-rw-r--r--src/utils/mac/SkNSView.mm9
-rw-r--r--src/utils/mac/SkOSWindow_Mac.mm4
-rw-r--r--src/utils/mac/SkSampleNSView.h2
4 files changed, 12 insertions, 7 deletions
diff --git a/src/utils/mac/SkNSView.h b/src/utils/mac/SkNSView.h
index 87c2727d18..6b8989a713 100644
--- a/src/utils/mac/SkNSView.h
+++ b/src/utils/mac/SkNSView.h
@@ -42,7 +42,7 @@ class SkEvent;
- (void)postInvalWithRect:(const SkIRect*)rectOrNil;
- (BOOL)onHandleEvent:(const SkEvent&)event;
-- (void)attachGL;
+- (bool)attachGL;
- (void)detachGL;
- (void)presentGL;
-@end \ No newline at end of file
+@end
diff --git a/src/utils/mac/SkNSView.mm b/src/utils/mac/SkNSView.mm
index c498bf5f09..b520dd5f7f 100644
--- a/src/utils/mac/SkNSView.mm
+++ b/src/utils/mac/SkNSView.mm
@@ -265,9 +265,13 @@ CGLContextObj createGLContext() {
[fGLContext setView:self];
}
}
-- (void)attachGL {
- if (nil == fGLContext)
+- (bool)attachGL {
+ if (nil == fGLContext) {
fGLContext = [[NSOpenGLContext alloc] initWithCGLContextObj:createGLContext()];
+ if (NULL == fGLContext) {
+ return false;
+ }
+ }
[fGLContext makeCurrentContext];
@@ -275,6 +279,7 @@ CGLContextObj createGLContext() {
glClearColor(0, 0, 0, 0);
glClearStencil(0);
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ return true;
}
- (void)detachGL {
diff --git a/src/utils/mac/SkOSWindow_Mac.mm b/src/utils/mac/SkOSWindow_Mac.mm
index def95f5bc3..7ac36d54a7 100644
--- a/src/utils/mac/SkOSWindow_Mac.mm
+++ b/src/utils/mac/SkOSWindow_Mac.mm
@@ -64,7 +64,7 @@ void SkOSWindow::onUpdateMenu(const SkOSMenu* menu) {
}
bool SkOSWindow::attachGL() {
- [(SkNSView*)fHWND attachGL];
+ return [(SkNSView*)fHWND attachGL];
}
void SkOSWindow::detachGL() {
@@ -75,4 +75,4 @@ void SkOSWindow::presentGL() {
[(SkNSView*)fHWND presentGL];
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/utils/mac/SkSampleNSView.h b/src/utils/mac/SkSampleNSView.h
index 6e38851efe..d3aca9a735 100644
--- a/src/utils/mac/SkSampleNSView.h
+++ b/src/utils/mac/SkSampleNSView.h
@@ -9,4 +9,4 @@
#import "SkNSView.h"
@interface SkSampleNSView : SkNSView
- (id)initWithDefaults;
-@end \ No newline at end of file
+@end