| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/cpp/graphics_2d.h" | 5 #include "ppapi/cpp/graphics_2d.h" |
| 6 #include "ppapi/cpp/image_data.h" | 6 #include "ppapi/cpp/image_data.h" |
| 7 #include "ppapi/cpp/instance.h" | 7 #include "ppapi/cpp/instance.h" |
| 8 #include "ppapi/cpp/logging.h" | 8 #include "ppapi/cpp/logging.h" |
| 9 #include "ppapi/cpp/module.h" | 9 #include "ppapi/cpp/module.h" |
| 10 #include "ppapi/cpp/private/flash.h" | 10 #include "ppapi/cpp/private/flash.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 for (int y = rect.y(); y < rect.y() + rect.height(); y++) { | 102 for (int y = rect.y(); y < rect.y() + rect.height(); y++) { |
| 103 *image.GetAddr32(pp::Point(rect.x(), y)) = 0xff202020; | 103 *image.GetAddr32(pp::Point(rect.x(), y)) = 0xff202020; |
| 104 *image.GetAddr32(pp::Point(rect.x() + rect.width() - 1, y)) = 0xff202020; | 104 *image.GetAddr32(pp::Point(rect.x() + rect.width() - 1, y)) = 0xff202020; |
| 105 } | 105 } |
| 106 | 106 |
| 107 return image; | 107 return image; |
| 108 } | 108 } |
| 109 | 109 |
| 110 pp::CompletionCallbackFactory<MyInstance> callback_factory_; | 110 pp::CompletionCallbackFactory<MyInstance> callback_factory_; |
| 111 | 111 |
| 112 int32_t timer_interval_; | |
| 113 | |
| 114 // Painting stuff. | 112 // Painting stuff. |
| 115 pp::Size size_; | 113 pp::Size size_; |
| 116 pp::Graphics2D device_context_; | 114 pp::Graphics2D device_context_; |
| 117 bool pending_paint_; | 115 bool pending_paint_; |
| 118 bool waiting_for_flush_completion_; | 116 bool waiting_for_flush_completion_; |
| 119 }; | 117 }; |
| 120 | 118 |
| 121 class MyModule : public pp::Module { | 119 class MyModule : public pp::Module { |
| 122 public: | 120 public: |
| 123 virtual pp::Instance* CreateInstance(PP_Instance instance) { | 121 virtual pp::Instance* CreateInstance(PP_Instance instance) { |
| 124 return new MyInstance(instance); | 122 return new MyInstance(instance); |
| 125 } | 123 } |
| 126 }; | 124 }; |
| 127 | 125 |
| 128 namespace pp { | 126 namespace pp { |
| 129 | 127 |
| 130 // Factory function for your specialization of the Module object. | 128 // Factory function for your specialization of the Module object. |
| 131 Module* CreateModule() { | 129 Module* CreateModule() { |
| 132 return new MyModule(); | 130 return new MyModule(); |
| 133 } | 131 } |
| 134 | 132 |
| 135 } // namespace pp | 133 } // namespace pp |
| OLD | NEW |