| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_PLUGIN_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_PLUGIN_H_ |
| 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_PLUGIN_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_PLUGIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "cc/layers/texture_layer.h" | 12 #include "cc/layers/texture_layer.h" |
| 13 #include "cc/layers/texture_layer_client.h" | 13 #include "cc/layers/texture_layer_client.h" |
| 14 #include "content/public/test/layouttest_support.h" | 14 #include "content/public/test/layouttest_support.h" |
| 15 #include "third_party/WebKit/public/platform/WebExternalTextureLayer.h" | 15 #include "third_party/WebKit/public/platform/WebExternalTextureLayer.h" |
| 16 #include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h" | 16 #include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h" |
| 17 #include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h" | 17 #include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h" |
| 18 #include "third_party/WebKit/public/platform/WebLayer.h" | 18 #include "third_party/WebKit/public/platform/WebLayer.h" |
| 19 #include "third_party/WebKit/public/web/WebPlugin.h" | 19 #include "third_party/WebKit/public/web/WebPlugin.h" |
| 20 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 20 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
| 21 | 21 |
| 22 namespace blink { | 22 namespace blink { |
| 23 class WebFrame; | 23 class WebFrame; |
| 24 class WebLayer; | 24 class WebLayer; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace cc { |
| 28 class SharedBitmap; |
| 29 } |
| 30 |
| 27 namespace content { | 31 namespace content { |
| 28 | 32 |
| 29 class WebTestDelegate; | 33 class WebTestDelegate; |
| 30 | 34 |
| 31 // A fake implemention of blink::WebPlugin for testing purposes. | 35 // A fake implemention of blink::WebPlugin for testing purposes. |
| 32 // | 36 // |
| 33 // It uses WebGraphicsContext3D to paint a scene consisiting of a primitive | 37 // It uses WebGraphicsContext3D to paint a scene consisiting of a primitive |
| 34 // over a background. The primitive and background can be customized using | 38 // over a background. The primitive and background can be customized using |
| 35 // the following plugin parameters: | 39 // the following plugin parameters: |
| 36 // primitive: none (default), triangle. | 40 // primitive: none (default), triangle. |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void DrawSceneGL(); | 136 void DrawSceneGL(); |
| 133 void DestroyScene(); | 137 void DestroyScene(); |
| 134 bool InitProgram(); | 138 bool InitProgram(); |
| 135 bool InitPrimitive(); | 139 bool InitPrimitive(); |
| 136 void DrawPrimitive(); | 140 void DrawPrimitive(); |
| 137 unsigned LoadShader(unsigned type, const std::string& source); | 141 unsigned LoadShader(unsigned type, const std::string& source); |
| 138 unsigned LoadProgram(const std::string& vertex_source, | 142 unsigned LoadProgram(const std::string& vertex_source, |
| 139 const std::string& fragment_source); | 143 const std::string& fragment_source); |
| 140 | 144 |
| 141 // Functions for drawing scene in Software. | 145 // Functions for drawing scene in Software. |
| 142 void DrawSceneSoftware(void* memory, size_t bytes); | 146 void DrawSceneSoftware(void* memory); |
| 143 | 147 |
| 144 blink::WebFrame* frame_; | 148 blink::WebFrame* frame_; |
| 145 WebTestDelegate* delegate_; | 149 WebTestDelegate* delegate_; |
| 146 blink::WebPluginContainer* container_; | 150 blink::WebPluginContainer* container_; |
| 147 | 151 |
| 148 blink::WebRect rect_; | 152 blink::WebRect rect_; |
| 149 blink::WebGraphicsContext3D* context_; | 153 blink::WebGraphicsContext3D* context_; |
| 150 unsigned color_texture_; | 154 unsigned color_texture_; |
| 151 cc::TextureMailbox texture_mailbox_; | 155 cc::TextureMailbox texture_mailbox_; |
| 152 scoped_ptr<base::SharedMemory> shared_bitmap_; | 156 scoped_ptr<cc::SharedBitmap> shared_bitmap_; |
| 153 bool mailbox_changed_; | 157 bool mailbox_changed_; |
| 154 unsigned framebuffer_; | 158 unsigned framebuffer_; |
| 155 Scene scene_; | 159 Scene scene_; |
| 156 scoped_refptr<cc::TextureLayer> layer_; | 160 scoped_refptr<cc::TextureLayer> layer_; |
| 157 scoped_ptr<blink::WebLayer> web_layer_; | 161 scoped_ptr<blink::WebLayer> web_layer_; |
| 158 | 162 |
| 159 blink::WebPluginContainer::TouchEventRequestType touch_event_request_; | 163 blink::WebPluginContainer::TouchEventRequestType touch_event_request_; |
| 160 // Requests touch events from the WebPluginContainerImpl multiple times to | 164 // Requests touch events from the WebPluginContainerImpl multiple times to |
| 161 // tickle webkit.org/b/108381 | 165 // tickle webkit.org/b/108381 |
| 162 bool re_request_touch_events_; | 166 bool re_request_touch_events_; |
| 163 bool print_event_details_; | 167 bool print_event_details_; |
| 164 bool print_user_gesture_status_; | 168 bool print_user_gesture_status_; |
| 165 bool can_process_drag_; | 169 bool can_process_drag_; |
| 166 | 170 |
| 167 bool is_persistent_; | 171 bool is_persistent_; |
| 168 bool can_create_without_renderer_; | 172 bool can_create_without_renderer_; |
| 169 | 173 |
| 170 DISALLOW_COPY_AND_ASSIGN(TestPlugin); | 174 DISALLOW_COPY_AND_ASSIGN(TestPlugin); |
| 171 }; | 175 }; |
| 172 | 176 |
| 173 } // namespace content | 177 } // namespace content |
| 174 | 178 |
| 175 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_PLUGIN_H_ | 179 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_PLUGIN_H_ |
| OLD | NEW |