| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkWindow_DEFINED | 8 #ifndef SkWindow_DEFINED |
| 9 #define SkWindow_DEFINED | 9 #define SkWindow_DEFINED |
| 10 | 10 |
| 11 #include "SkView.h" | 11 #include "SkView.h" |
| 12 #include "SkBitmap.h" | 12 #include "SkBitmap.h" |
| 13 #include "SkMatrix.h" | 13 #include "SkMatrix.h" |
| 14 #include "SkRegion.h" | 14 #include "SkRegion.h" |
| 15 #include "SkEvent.h" | 15 #include "SkEvent.h" |
| 16 #include "SkKey.h" | 16 #include "SkKey.h" |
| 17 #include "SkSurfaceProps.h" | 17 #include "SkSurfaceProps.h" |
| 18 #include "SkTDArray.h" | 18 #include "SkTDArray.h" |
| 19 | 19 |
| 20 #ifdef SK_BUILD_FOR_WINCEx | 20 #ifdef SK_BUILD_FOR_WINCEx |
| 21 #define SHOW_FPS | 21 #define SHOW_FPS |
| 22 #endif | 22 #endif |
| 23 //#define USE_GX_SCREEN | 23 //#define USE_GX_SCREEN |
| 24 | 24 |
| 25 class SkSurface; | 25 class SkSurface; |
| 26 class SkOSMenu; | 26 class SkOSMenu; |
| 27 | 27 |
| 28 #if SK_SUPPORT_GPU |
| 29 struct GrGLInterface; |
| 30 class GrContext; |
| 31 class GrRenderTarget; |
| 32 #endif |
| 33 |
| 28 class SkWindow : public SkView { | 34 class SkWindow : public SkView { |
| 29 public: | 35 public: |
| 30 SkWindow(); | 36 SkWindow(); |
| 31 virtual ~SkWindow(); | 37 virtual ~SkWindow(); |
| 32 | 38 |
| 39 struct AttachmentInfo { |
| 40 int fSampleCount; |
| 41 int fStencilBits; |
| 42 }; |
| 43 |
| 33 SkSurfaceProps getSurfaceProps() const { return fSurfaceProps; } | 44 SkSurfaceProps getSurfaceProps() const { return fSurfaceProps; } |
| 34 void setSurfaceProps(const SkSurfaceProps& props) { | 45 void setSurfaceProps(const SkSurfaceProps& props) { |
| 35 fSurfaceProps = props; | 46 fSurfaceProps = props; |
| 36 } | 47 } |
| 37 | 48 |
| 38 const SkBitmap& getBitmap() const { return fBitmap; } | 49 const SkBitmap& getBitmap() const { return fBitmap; } |
| 39 | 50 |
| 40 void setColorType(SkColorType); | 51 void setColorType(SkColorType); |
| 41 void resize(int width, int height, SkColorType = kUnknown_SkColorType); | 52 void resize(int width, int height, SkColorType = kUnknown_SkColorType); |
| 42 | 53 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 virtual bool onHandleKeyUp(SkKey); | 89 virtual bool onHandleKeyUp(SkKey); |
| 79 virtual void onAddMenu(const SkOSMenu*) {}; | 90 virtual void onAddMenu(const SkOSMenu*) {}; |
| 80 virtual void onUpdateMenu(const SkOSMenu*) {}; | 91 virtual void onUpdateMenu(const SkOSMenu*) {}; |
| 81 virtual void onSetTitle(const char title[]) {} | 92 virtual void onSetTitle(const char title[]) {} |
| 82 | 93 |
| 83 // overrides from SkView | 94 // overrides from SkView |
| 84 virtual bool handleInval(const SkRect*); | 95 virtual bool handleInval(const SkRect*); |
| 85 virtual bool onGetFocusView(SkView** focus) const; | 96 virtual bool onGetFocusView(SkView** focus) const; |
| 86 virtual bool onSetFocusView(SkView* focus); | 97 virtual bool onSetFocusView(SkView* focus); |
| 87 | 98 |
| 99 #if SK_SUPPORT_GPU |
| 100 GrRenderTarget* renderTarget(const AttachmentInfo& attachmentInfo, |
| 101 const GrGLInterface* , GrContext* grContext); |
| 102 #endif |
| 103 |
| 88 private: | 104 private: |
| 89 SkSurfaceProps fSurfaceProps; | 105 SkSurfaceProps fSurfaceProps; |
| 90 SkColorType fColorType; | 106 SkColorType fColorType; |
| 91 SkBitmap fBitmap; | 107 SkBitmap fBitmap; |
| 92 SkRegion fDirtyRgn; | 108 SkRegion fDirtyRgn; |
| 93 | 109 |
| 94 SkTDArray<Click*> fClicks; // to track clicks | 110 SkTDArray<Click*> fClicks; // to track clicks |
| 95 | 111 |
| 96 SkTDArray<SkOSMenu*> fMenus; | 112 SkTDArray<SkOSMenu*> fMenus; |
| 97 | 113 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 116 #include "SkOSWindow_Android.h" | 132 #include "SkOSWindow_Android.h" |
| 117 #elif defined(SK_BUILD_FOR_UNIX) | 133 #elif defined(SK_BUILD_FOR_UNIX) |
| 118 #include "SkOSWindow_Unix.h" | 134 #include "SkOSWindow_Unix.h" |
| 119 #elif defined(SK_BUILD_FOR_SDL) | 135 #elif defined(SK_BUILD_FOR_SDL) |
| 120 #include "SkOSWindow_SDL.h" | 136 #include "SkOSWindow_SDL.h" |
| 121 #elif defined(SK_BUILD_FOR_IOS) | 137 #elif defined(SK_BUILD_FOR_IOS) |
| 122 #include "SkOSWindow_iOS.h" | 138 #include "SkOSWindow_iOS.h" |
| 123 #endif | 139 #endif |
| 124 | 140 |
| 125 #endif | 141 #endif |
| OLD | NEW |