epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame^] | 1 | |
| 2 | /* |
| 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
yangsu@google.com | c5aeccd | 2011-07-17 14:42:08 +0000 | [diff] [blame] | 8 | #import <OpenGLES/EAGL.h> |
| 9 | #import <OpenGLES/ES1/gl.h> |
| 10 | #import <OpenGLES/ES1/glext.h> |
| 11 | #import <OpenGLES/ES2/gl.h> |
| 12 | #import <OpenGLES/ES2/glext.h> |
yangsu@google.com | 2ba30c0 | 2011-07-19 15:17:44 +0000 | [diff] [blame] | 13 | #import <QuartzCore/QuartzCore.h> |
| 14 | #import <UIKit/UIKit.h> |
yangsu@google.com | c5aeccd | 2011-07-17 14:42:08 +0000 | [diff] [blame] | 15 | #include "SkMatrix.h" |
| 16 | #include "FlingState.h" |
| 17 | #include "SampleApp.h" |
| 18 | #include "SkiOSDeviceManager.h" |
| 19 | class SkOSWindow; |
| 20 | class SkEvent; |
| 21 | struct FPSState; |
| 22 | @interface SkUIView : UIView <UIAccelerometerDelegate> { |
| 23 | BOOL fRedrawRequestPending; |
| 24 | SkMatrix fMatrix; |
| 25 | |
| 26 | float fZoomAroundX, fZoomAroundY; |
| 27 | bool fZoomAround; |
| 28 | |
| 29 | struct { |
| 30 | EAGLContext* fContext; |
| 31 | GLuint fRenderbuffer; |
| 32 | GLuint fStencilbuffer; |
| 33 | GLuint fFramebuffer; |
| 34 | GLint fWidth; |
| 35 | GLint fHeight; |
| 36 | } fGL; |
yangsu@google.com | 2ba30c0 | 2011-07-19 15:17:44 +0000 | [diff] [blame] | 37 | |
yangsu@google.com | c5aeccd | 2011-07-17 14:42:08 +0000 | [diff] [blame] | 38 | FPSState* fFPSState; |
| 39 | NSString* fTitle; |
| 40 | UINavigationItem* fTitleItem; |
| 41 | SkOSWindow* fWind; |
yangsu@google.com | 2ba30c0 | 2011-07-19 15:17:44 +0000 | [diff] [blame] | 42 | CALayer* fRasterLayer; |
| 43 | CAEAGLLayer* fGLLayer; |
yangsu@google.com | c5aeccd | 2011-07-17 14:42:08 +0000 | [diff] [blame] | 44 | |
| 45 | SkiOSDeviceManager* fDevManager; |
| 46 | } |
| 47 | |
| 48 | @property (nonatomic, assign) SkOSWindow *fWind; |
| 49 | @property (nonatomic, retain) UINavigationItem* fTitleItem; |
| 50 | @property (nonatomic, copy) NSString* fTitle; |
yangsu@google.com | 2ba30c0 | 2011-07-19 15:17:44 +0000 | [diff] [blame] | 51 | @property (nonatomic, retain) CALayer* fRasterLayer; |
| 52 | @property (nonatomic, retain) CAEAGLLayer* fGLLayer; |
| 53 | |
| 54 | - (void)forceRedraw; |
yangsu@google.com | c5aeccd | 2011-07-17 14:42:08 +0000 | [diff] [blame] | 55 | |
| 56 | - (void)setSkTitle:(const char*)title; |
| 57 | - (void)postInvalWithRect:(const SkIRect*)rectOrNil; |
| 58 | - (BOOL)onHandleEvent:(const SkEvent&)event; |
yangsu@google.com | c5aeccd | 2011-07-17 14:42:08 +0000 | [diff] [blame] | 59 | @end |
| 60 | |