| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_MAIN_PPAPI_INSTANCE2D_H_ | |
| 6 #define PPAPI_MAIN_PPAPI_INSTANCE2D_H_ | |
| 7 | |
| 8 #include "ppapi/c/pp_instance.h" | |
| 9 | |
| 10 #include "ppapi/cpp/graphics_2d.h" | |
| 11 #include "ppapi/cpp/instance.h" | |
| 12 #include "ppapi/cpp/size.h" | |
| 13 | |
| 14 #include "ppapi_main/ppapi_instance.h" | |
| 15 | |
| 16 | |
| 17 class PPAPIInstance2D : public PPAPIInstance { | |
| 18 public: | |
| 19 PPAPIInstance2D(PP_Instance instance, const char *args[]); | |
| 20 virtual ~PPAPIInstance2D(); | |
| 21 | |
| 22 // Called when we need to rebuild the context | |
| 23 virtual void BuildContext(int32_t result, const pp::Size& new_size); | |
| 24 | |
| 25 // Called whenever a swap takes place | |
| 26 virtual void Flushed(int result); | |
| 27 | |
| 28 virtual void Render(PP_Resource ctx, uint32_t width, uint32_t height); | |
| 29 static PPAPIInstance2D* GetInstance2D(); | |
| 30 | |
| 31 protected: | |
| 32 pp::Graphics2D device_context_; | |
| 33 }; | |
| 34 | |
| 35 | |
| 36 #endif // PPAPI_MAIN_PPAPI_INSTANCE2D_H_ | |
| OLD | NEW |