| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EMBEDDERS_OPENGLUI_COMMON_GRAPHICS_HANDLER_H_ | 5 #ifndef EMBEDDERS_OPENGLUI_COMMON_GRAPHICS_HANDLER_H_ |
| 6 #define EMBEDDERS_OPENGLUI_COMMON_GRAPHICS_HANDLER_H_ | 6 #define EMBEDDERS_OPENGLUI_COMMON_GRAPHICS_HANDLER_H_ |
| 7 | 7 |
| 8 #include "embedders/openglui/common/isized.h" | 8 #include "embedders/openglui/common/isized.h" |
| 9 #include "embedders/openglui/common/opengl.h" | 9 #include "embedders/openglui/common/opengl.h" |
| 10 #include "embedders/openglui/common/support.h" | 10 #include "embedders/openglui/common/support.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 virtual void Stop(); | 29 virtual void Stop(); |
| 30 | 30 |
| 31 void SwapBuffers() { | 31 void SwapBuffers() { |
| 32 GLSwapBuffers(); | 32 GLSwapBuffers(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 virtual int32_t Update(); | 35 virtual int32_t Update(); |
| 36 | 36 |
| 37 void SetViewport(int left, int top, int width, int height); | 37 void SetViewport(int left, int top, int width, int height); |
| 38 | 38 |
| 39 SkCanvas* CreateCanvas(); | 39 SkCanvas* CreateDisplayCanvas(); |
| 40 | 40 SkCanvas* CreateBitmapCanvas(int width, int height); |
| 41 void Flush() { | |
| 42 // TODO(gram): see if we really need this. | |
| 43 grcontext->flush(); | |
| 44 } | |
| 45 | 41 |
| 46 virtual ~GraphicsHandler() { | 42 virtual ~GraphicsHandler() { |
| 47 } | 43 } |
| 48 | 44 |
| 49 protected: | 45 protected: |
| 50 SkAutoGraphics ag; | 46 SkAutoGraphics ag; |
| 51 GrContext* grcontext; | 47 GrContext* grcontext; |
| 52 int32_t width_, height_; | 48 int32_t width_, height_; |
| 53 }; | 49 }; |
| 54 | 50 |
| 55 extern GraphicsHandler* graphics; | 51 extern GraphicsHandler* graphics; |
| 56 | 52 |
| 57 #endif // EMBEDDERS_OPENGLUI_COMMON_GRAPHICS_HANDLER_H_ | 53 #endif // EMBEDDERS_OPENGLUI_COMMON_GRAPHICS_HANDLER_H_ |
| 58 | 54 |
| OLD | NEW |