blob: 33c487e2c6eb394ee5f964cfefd74a700f08679f [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
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.comc5aeccd2011-07-17 14:42:08 +00008#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.com2ba30c02011-07-19 15:17:44 +000013#import <QuartzCore/QuartzCore.h>
14#import <UIKit/UIKit.h>
yangsu@google.comc5aeccd2011-07-17 14:42:08 +000015#include "SkMatrix.h"
16#include "FlingState.h"
17#include "SampleApp.h"
18#include "SkiOSDeviceManager.h"
19class SkOSWindow;
20class SkEvent;
21struct 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.com2ba30c02011-07-19 15:17:44 +000037
yangsu@google.comc5aeccd2011-07-17 14:42:08 +000038 FPSState* fFPSState;
39 NSString* fTitle;
40 UINavigationItem* fTitleItem;
41 SkOSWindow* fWind;
yangsu@google.com2ba30c02011-07-19 15:17:44 +000042 CALayer* fRasterLayer;
43 CAEAGLLayer* fGLLayer;
yangsu@google.comc5aeccd2011-07-17 14:42:08 +000044
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.com2ba30c02011-07-19 15:17:44 +000051@property (nonatomic, retain) CALayer* fRasterLayer;
52@property (nonatomic, retain) CAEAGLLayer* fGLLayer;
53
54- (void)forceRedraw;
yangsu@google.comc5aeccd2011-07-17 14:42:08 +000055
56- (void)setSkTitle:(const char*)title;
57- (void)postInvalWithRect:(const SkIRect*)rectOrNil;
58- (BOOL)onHandleEvent:(const SkEvent&)event;
yangsu@google.comc5aeccd2011-07-17 14:42:08 +000059@end
60