Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: components/test_runner/test_plugin.h

Issue 1814263004: Remove create/delete methods from WebGraphicsContext3D. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@complex-casts
Patch Set: complex-create: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 COMPONENTS_TEST_RUNNER_TEST_PLUGIN_H_ 5 #ifndef COMPONENTS_TEST_RUNNER_TEST_PLUGIN_H_
6 #define COMPONENTS_TEST_RUNNER_TEST_PLUGIN_H_ 6 #define COMPONENTS_TEST_RUNNER_TEST_PLUGIN_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.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 "third_party/WebKit/public/platform/WebExternalTextureLayer.h" 14 #include "third_party/WebKit/public/platform/WebExternalTextureLayer.h"
15 #include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h" 15 #include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h"
16 #include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h" 16 #include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h"
17 #include "third_party/WebKit/public/platform/WebLayer.h" 17 #include "third_party/WebKit/public/platform/WebLayer.h"
18 #include "third_party/WebKit/public/web/WebPlugin.h" 18 #include "third_party/WebKit/public/web/WebPlugin.h"
19 #include "third_party/WebKit/public/web/WebPluginContainer.h" 19 #include "third_party/WebKit/public/web/WebPluginContainer.h"
20 #include "third_party/khronos/GLES2/gl2.h"
20 21
21 namespace blink { 22 namespace blink {
22 class WebFrame; 23 class WebFrame;
23 class WebGraphicsContext3D; 24 class WebGraphicsContext3D;
24 class WebLayer; 25 class WebLayer;
25 struct WebPluginParams; 26 struct WebPluginParams;
26 } 27 }
27 28
28 namespace cc { 29 namespace cc {
29 class SharedBitmap; 30 class SharedBitmap;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 102
102 private: 103 private:
103 TestPlugin(blink::WebFrame* frame, 104 TestPlugin(blink::WebFrame* frame,
104 const blink::WebPluginParams& params, 105 const blink::WebPluginParams& params,
105 WebTestDelegate* delegate); 106 WebTestDelegate* delegate);
106 107
107 enum Primitive { PrimitiveNone, PrimitiveTriangle }; 108 enum Primitive { PrimitiveNone, PrimitiveTriangle };
108 109
109 struct Scene { 110 struct Scene {
110 Primitive primitive; 111 Primitive primitive;
111 unsigned background_color[3]; 112 uint8_t background_color[3];
112 unsigned primitive_color[3]; 113 uint8_t primitive_color[3];
113 float opacity; 114 float opacity;
114 115
115 unsigned vbo; 116 GLuint vbo;
116 unsigned program; 117 GLuint program;
117 int color_location; 118 int color_location;
118 int position_location; 119 int position_location;
119 120
120 Scene() 121 Scene()
121 : primitive(PrimitiveNone), 122 : primitive(PrimitiveNone),
122 opacity(1.0f) // Fully opaque. 123 opacity(1.0f) // Fully opaque.
123 , 124 ,
124 vbo(0), 125 vbo(0),
125 program(0), 126 program(0),
126 color_location(-1), 127 color_location(-1),
127 position_location(-1) { 128 position_location(-1) {
128 background_color[0] = background_color[1] = background_color[2] = 0; 129 background_color[0] = background_color[1] = background_color[2] = 0;
129 primitive_color[0] = primitive_color[1] = primitive_color[2] = 0; 130 primitive_color[0] = primitive_color[1] = primitive_color[2] = 0;
130 } 131 }
131 }; 132 };
132 133
133 // Functions for parsing plugin parameters. 134 // Functions for parsing plugin parameters.
134 Primitive ParsePrimitive(const blink::WebString& string); 135 Primitive ParsePrimitive(const blink::WebString& string);
135 void ParseColor(const blink::WebString& string, unsigned color[3]); 136 void ParseColor(const blink::WebString& string, uint8_t color[3]);
136 float ParseOpacity(const blink::WebString& string); 137 float ParseOpacity(const blink::WebString& string);
137 bool ParseBoolean(const blink::WebString& string); 138 bool ParseBoolean(const blink::WebString& string);
138 139
139 // Functions for loading and drawing scene in GL. 140 // Functions for loading and drawing scene in GL.
140 bool InitScene(); 141 bool InitScene();
141 void DrawSceneGL(); 142 void DrawSceneGL();
142 void DestroyScene(); 143 void DestroyScene();
143 bool InitProgram(); 144 bool InitProgram();
144 bool InitPrimitive(); 145 bool InitPrimitive();
145 void DrawPrimitive(); 146 void DrawPrimitive();
146 unsigned LoadShader(unsigned type, const std::string& source); 147 GLuint LoadShader(GLenum type, const std::string& source);
147 unsigned LoadProgram(const std::string& vertex_source, 148 GLuint LoadProgram(const std::string& vertex_source,
148 const std::string& fragment_source); 149 const std::string& fragment_source);
149 150
150 // Functions for drawing scene in Software. 151 // Functions for drawing scene in Software.
151 void DrawSceneSoftware(void* memory); 152 void DrawSceneSoftware(void* memory);
152 153
153 blink::WebFrame* frame_; 154 blink::WebFrame* frame_;
154 WebTestDelegate* delegate_; 155 WebTestDelegate* delegate_;
155 blink::WebPluginContainer* container_; 156 blink::WebPluginContainer* container_;
156 157
157 blink::WebRect rect_; 158 blink::WebRect rect_;
158 blink::WebGraphicsContext3D* context_; 159 blink::WebGraphicsContext3D* context_;
159 gpu::gles2::GLES2Interface* gl_; 160 gpu::gles2::GLES2Interface* gl_;
160 unsigned color_texture_; 161 GLuint color_texture_;
161 cc::TextureMailbox texture_mailbox_; 162 cc::TextureMailbox texture_mailbox_;
162 scoped_ptr<cc::SharedBitmap> shared_bitmap_; 163 scoped_ptr<cc::SharedBitmap> shared_bitmap_;
163 bool mailbox_changed_; 164 bool mailbox_changed_;
164 unsigned framebuffer_; 165 GLuint framebuffer_;
165 Scene scene_; 166 Scene scene_;
166 scoped_refptr<cc::TextureLayer> layer_; 167 scoped_refptr<cc::TextureLayer> layer_;
167 scoped_ptr<blink::WebLayer> web_layer_; 168 scoped_ptr<blink::WebLayer> web_layer_;
168 169
169 blink::WebPluginContainer::TouchEventRequestType touch_event_request_; 170 blink::WebPluginContainer::TouchEventRequestType touch_event_request_;
170 // Requests touch events from the WebPluginContainerImpl multiple times to 171 // Requests touch events from the WebPluginContainerImpl multiple times to
171 // tickle webkit.org/b/108381 172 // tickle webkit.org/b/108381
172 bool re_request_touch_events_; 173 bool re_request_touch_events_;
173 bool print_event_details_; 174 bool print_event_details_;
174 bool print_user_gesture_status_; 175 bool print_user_gesture_status_;
175 bool can_process_drag_; 176 bool can_process_drag_;
176 bool supports_keyboard_focus_; 177 bool supports_keyboard_focus_;
177 178
178 bool is_persistent_; 179 bool is_persistent_;
179 bool can_create_without_renderer_; 180 bool can_create_without_renderer_;
180 181
181 DISALLOW_COPY_AND_ASSIGN(TestPlugin); 182 DISALLOW_COPY_AND_ASSIGN(TestPlugin);
182 }; 183 };
183 184
184 } // namespace test_runner 185 } // namespace test_runner
185 186
186 #endif // COMPONENTS_TEST_RUNNER_TEST_PLUGIN_H_ 187 #endif // COMPONENTS_TEST_RUNNER_TEST_PLUGIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698