| 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 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 const char* getTitle() const { return fTitle.c_str(); } | 73 const char* getTitle() const { return fTitle.c_str(); } |
| 74 void setTitle(const char title[]); | 74 void setTitle(const char title[]); |
| 75 | 75 |
| 76 const SkMatrix& getMatrix() const { return fMatrix; } | 76 const SkMatrix& getMatrix() const { return fMatrix; } |
| 77 void setMatrix(const SkMatrix&); | 77 void setMatrix(const SkMatrix&); |
| 78 void preConcat(const SkMatrix&); | 78 void preConcat(const SkMatrix&); |
| 79 void postConcat(const SkMatrix&); | 79 void postConcat(const SkMatrix&); |
| 80 | 80 |
| 81 virtual sk_sp<SkSurface> makeSurface(); | 81 virtual sk_sp<SkSurface> makeSurface(); |
| 82 | 82 |
| 83 #if SK_SUPPORT_GPU |
| 84 sk_sp<SkSurface> makeGpuBackedSurface(const AttachmentInfo& attachmentInfo, |
| 85 const GrGLInterface* , GrContext* grCo
ntext); |
| 86 #endif |
| 87 |
| 83 protected: | 88 protected: |
| 84 virtual bool onEvent(const SkEvent&); | 89 virtual bool onEvent(const SkEvent&); |
| 85 virtual bool onDispatchClick(int x, int y, Click::State, void* owner, unsign
ed modi); | 90 virtual bool onDispatchClick(int x, int y, Click::State, void* owner, unsign
ed modi); |
| 86 // called if part of our bitmap is invalidated | 91 // called if part of our bitmap is invalidated |
| 87 virtual void onHandleInval(const SkIRect&); | 92 virtual void onHandleInval(const SkIRect&); |
| 88 virtual bool onHandleChar(SkUnichar); | 93 virtual bool onHandleChar(SkUnichar); |
| 89 virtual bool onHandleKey(SkKey); | 94 virtual bool onHandleKey(SkKey); |
| 90 virtual bool onHandleKeyUp(SkKey); | 95 virtual bool onHandleKeyUp(SkKey); |
| 91 virtual void onAddMenu(const SkOSMenu*) {}; | 96 virtual void onAddMenu(const SkOSMenu*) {}; |
| 92 virtual void onUpdateMenu(const SkOSMenu*) {}; | 97 virtual void onUpdateMenu(const SkOSMenu*) {}; |
| 93 virtual void onSetTitle(const char title[]) {} | 98 virtual void onSetTitle(const char title[]) {} |
| 94 | 99 |
| 95 // overrides from SkView | 100 // overrides from SkView |
| 96 virtual bool handleInval(const SkRect*); | 101 virtual bool handleInval(const SkRect*); |
| 97 virtual bool onGetFocusView(SkView** focus) const; | 102 virtual bool onGetFocusView(SkView** focus) const; |
| 98 virtual bool onSetFocusView(SkView* focus); | 103 virtual bool onSetFocusView(SkView* focus); |
| 99 | 104 |
| 100 #if SK_SUPPORT_GPU | |
| 101 sk_sp<SkSurface> makeGpuBackedSurface(const AttachmentInfo& attachmentInfo, | |
| 102 const GrGLInterface* , GrContext* grCo
ntext); | |
| 103 #endif | |
| 104 | |
| 105 private: | 105 private: |
| 106 SkSurfaceProps fSurfaceProps; | 106 SkSurfaceProps fSurfaceProps; |
| 107 SkBitmap fBitmap; | 107 SkBitmap fBitmap; |
| 108 SkRegion fDirtyRgn; | 108 SkRegion fDirtyRgn; |
| 109 | 109 |
| 110 SkTDArray<Click*> fClicks; // to track clicks | 110 SkTDArray<Click*> fClicks; // to track clicks |
| 111 | 111 |
| 112 SkTDArray<SkOSMenu*> fMenus; | 112 SkTDArray<SkOSMenu*> fMenus; |
| 113 | 113 |
| 114 SkView* fFocusView; | 114 SkView* fFocusView; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 130 #include "SkOSWindow_Win.h" | 130 #include "SkOSWindow_Win.h" |
| 131 #elif defined(SK_BUILD_FOR_ANDROID) | 131 #elif defined(SK_BUILD_FOR_ANDROID) |
| 132 #error Android does not support SkOSWindow and SampleApp. Please use Viewer
instead. | 132 #error Android does not support SkOSWindow and SampleApp. Please use Viewer
instead. |
| 133 #elif defined(SK_BUILD_FOR_UNIX) | 133 #elif defined(SK_BUILD_FOR_UNIX) |
| 134 #include "SkOSWindow_Unix.h" | 134 #include "SkOSWindow_Unix.h" |
| 135 #elif defined(SK_BUILD_FOR_IOS) | 135 #elif defined(SK_BUILD_FOR_IOS) |
| 136 #include "SkOSWindow_iOS.h" | 136 #include "SkOSWindow_iOS.h" |
| 137 #endif | 137 #endif |
| 138 | 138 |
| 139 #endif | 139 #endif |
| OLD | NEW |