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

Side by Side Diff: ppapi/tests/test_compositor.cc

Issue 475123003: [PPAPI] Add target param for CompositorLayer::SetTexture(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review issues Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/shared_impl/compositor_layer_data.h ('k') | ppapi/thunk/ppb_compositor_layer_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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/tests/test_compositor.h" 5 #include "ppapi/tests/test_compositor.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <stdlib.h> 10 #include <stdlib.h>
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 VERIFY(SetColorLayer(color_layer, PP_OK)); 116 VERIFY(SetColorLayer(color_layer, PP_OK));
117 117
118 uint32_t texture = 0; 118 uint32_t texture = 0;
119 VERIFY(CreateTexture(&texture)); 119 VERIFY(CreateTexture(&texture));
120 pp::CompositorLayer texture_layer = compositor.AddLayer(); 120 pp::CompositorLayer texture_layer = compositor.AddLayer();
121 ASSERT_FALSE(texture_layer.is_null()); 121 ASSERT_FALSE(texture_layer.is_null());
122 TestCompletionCallback texture_release_callback(instance_->pp_instance(), 122 TestCompletionCallback texture_release_callback(instance_->pp_instance(),
123 PP_REQUIRED); 123 PP_REQUIRED);
124 ASSERT_EQ(PP_OK_COMPLETIONPENDING, 124 ASSERT_EQ(PP_OK_COMPLETIONPENDING,
125 texture_layer.SetTexture(graphics_3d, texture, pp::Size(100, 100), 125 texture_layer.SetTexture(graphics_3d, GL_TEXTURE_2D, texture,
126 pp::Size(100, 100),
126 texture_release_callback.GetCallback())); 127 texture_release_callback.GetCallback()));
127 128
128 pp::ImageData image; 129 pp::ImageData image;
129 VERIFY(CreateImage(&image)); 130 VERIFY(CreateImage(&image));
130 pp::CompositorLayer image_layer = compositor.AddLayer(); 131 pp::CompositorLayer image_layer = compositor.AddLayer();
131 TestCompletionCallback image_release_callback(instance_->pp_instance(), 132 TestCompletionCallback image_release_callback(instance_->pp_instance(),
132 PP_REQUIRED); 133 PP_REQUIRED);
133 ASSERT_EQ(PP_OK_COMPLETIONPENDING, 134 ASSERT_EQ(PP_OK_COMPLETIONPENDING,
134 image_layer.SetImage(image, pp::Size(100, 100), 135 image_layer.SetImage(image, pp::Size(100, 100),
135 image_release_callback.GetCallback())); 136 image_release_callback.GetCallback()));
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 195
195 VERIFY(SetColorLayer(color_layer, PP_OK)); 196 VERIFY(SetColorLayer(color_layer, PP_OK));
196 197
197 uint32_t texture = 0; 198 uint32_t texture = 0;
198 VERIFY(CreateTexture(&texture)); 199 VERIFY(CreateTexture(&texture));
199 pp::CompositorLayer texture_layer = compositor.AddLayer(); 200 pp::CompositorLayer texture_layer = compositor.AddLayer();
200 ASSERT_FALSE(texture_layer.is_null()); 201 ASSERT_FALSE(texture_layer.is_null());
201 TestCompletionCallback texture_release_callback(instance_->pp_instance(), 202 TestCompletionCallback texture_release_callback(instance_->pp_instance(),
202 PP_REQUIRED); 203 PP_REQUIRED);
203 ASSERT_EQ(PP_OK_COMPLETIONPENDING, 204 ASSERT_EQ(PP_OK_COMPLETIONPENDING,
204 texture_layer.SetTexture(graphics_3d, texture, pp::Size(100, 100), 205 texture_layer.SetTexture(graphics_3d, GL_TEXTURE_2D, texture,
206 pp::Size(100, 100),
205 texture_release_callback.GetCallback())); 207 texture_release_callback.GetCallback()));
206 208
207 pp::ImageData image; 209 pp::ImageData image;
208 VERIFY(CreateImage(&image)); 210 VERIFY(CreateImage(&image));
209 pp::CompositorLayer image_layer = compositor.AddLayer(); 211 pp::CompositorLayer image_layer = compositor.AddLayer();
210 TestCompletionCallback image_release_callback(instance_->pp_instance(), 212 TestCompletionCallback image_release_callback(instance_->pp_instance(),
211 PP_REQUIRED); 213 PP_REQUIRED);
212 ASSERT_EQ(PP_OK_COMPLETIONPENDING, 214 ASSERT_EQ(PP_OK_COMPLETIONPENDING,
213 image_layer.SetImage(image, pp::Size(100, 100), 215 image_layer.SetImage(image, pp::Size(100, 100),
214 image_release_callback.GetCallback())); 216 image_release_callback.GetCallback()));
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 260
259 VERIFY(SetColorLayer(color_layer, PP_OK)); 261 VERIFY(SetColorLayer(color_layer, PP_OK));
260 262
261 uint32_t texture = 0; 263 uint32_t texture = 0;
262 VERIFY(CreateTexture(&texture)); 264 VERIFY(CreateTexture(&texture));
263 pp::CompositorLayer texture_layer = compositor.AddLayer(); 265 pp::CompositorLayer texture_layer = compositor.AddLayer();
264 ASSERT_FALSE(texture_layer.is_null()); 266 ASSERT_FALSE(texture_layer.is_null());
265 TestCompletionCallback texture_release_callback(instance_->pp_instance(), 267 TestCompletionCallback texture_release_callback(instance_->pp_instance(),
266 PP_REQUIRED); 268 PP_REQUIRED);
267 ASSERT_EQ(PP_OK_COMPLETIONPENDING, 269 ASSERT_EQ(PP_OK_COMPLETIONPENDING,
268 texture_layer.SetTexture(graphics_3d, texture, pp::Size(100, 100), 270 texture_layer.SetTexture(graphics_3d, GL_TEXTURE_2D, texture,
271 pp::Size(100, 100),
269 texture_release_callback.GetCallback())); 272 texture_release_callback.GetCallback()));
270 273
271 pp::ImageData image; 274 pp::ImageData image;
272 VERIFY(CreateImage(&image)); 275 VERIFY(CreateImage(&image));
273 pp::CompositorLayer image_layer = compositor.AddLayer(); 276 pp::CompositorLayer image_layer = compositor.AddLayer();
274 TestCompletionCallback image_release_callback(instance_->pp_instance(), 277 TestCompletionCallback image_release_callback(instance_->pp_instance(),
275 PP_REQUIRED); 278 PP_REQUIRED);
276 ASSERT_EQ(PP_OK_COMPLETIONPENDING, 279 ASSERT_EQ(PP_OK_COMPLETIONPENDING,
277 image_layer.SetImage(image, pp::Size(100, 100), 280 image_layer.SetImage(image, pp::Size(100, 100),
278 image_release_callback.GetCallback())); 281 image_release_callback.GetCallback()));
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 ASSERT_FALSE(color_layer.is_null()); 343 ASSERT_FALSE(color_layer.is_null());
341 VERIFY(SetColorLayer(color_layer, PP_OK)); 344 VERIFY(SetColorLayer(color_layer, PP_OK));
342 345
343 uint32_t texture = 0; 346 uint32_t texture = 0;
344 VERIFY(CreateTexture(&texture)); 347 VERIFY(CreateTexture(&texture));
345 pp::CompositorLayer texture_layer = compositor.AddLayer(); 348 pp::CompositorLayer texture_layer = compositor.AddLayer();
346 ASSERT_FALSE(texture_layer.is_null()); 349 ASSERT_FALSE(texture_layer.is_null());
347 TestCompletionCallback texture_release_callback(instance_->pp_instance(), 350 TestCompletionCallback texture_release_callback(instance_->pp_instance(),
348 PP_REQUIRED); 351 PP_REQUIRED);
349 ASSERT_EQ(PP_OK_COMPLETIONPENDING, 352 ASSERT_EQ(PP_OK_COMPLETIONPENDING,
350 texture_layer.SetTexture(graphics_3d, texture, pp::Size(100, 100), 353 texture_layer.SetTexture(graphics_3d, texture, GL_TEXTURE_2D,
354 pp::Size(100, 100),
351 texture_release_callback.GetCallback())); 355 texture_release_callback.GetCallback()));
352 356
353 pp::ImageData image; 357 pp::ImageData image;
354 VERIFY(CreateImage(&image)); 358 VERIFY(CreateImage(&image));
355 pp::CompositorLayer image_layer = compositor.AddLayer(); 359 pp::CompositorLayer image_layer = compositor.AddLayer();
356 TestCompletionCallback image_release_callback(instance_->pp_instance(), 360 TestCompletionCallback image_release_callback(instance_->pp_instance(),
357 PP_REQUIRED); 361 PP_REQUIRED);
358 ASSERT_EQ(PP_OK_COMPLETIONPENDING, 362 ASSERT_EQ(PP_OK_COMPLETIONPENDING,
359 image_layer.SetImage(image, pp::Size(100, 100), 363 image_layer.SetImage(image, pp::Size(100, 100),
360 image_release_callback.GetCallback())); 364 image_release_callback.GetCallback()));
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 pp::CompositorLayer layer, int32_t result) { 425 pp::CompositorLayer layer, int32_t result) {
422 ASSERT_EQ(result, layer.SetColor(255, 255, 255, 255, pp::Size(100, 100))); 426 ASSERT_EQ(result, layer.SetColor(255, 255, 255, 255, pp::Size(100, 100)));
423 ASSERT_EQ(result, layer.SetClipRect(pp::Rect(0, 0, 50, 50))); 427 ASSERT_EQ(result, layer.SetClipRect(pp::Rect(0, 0, 50, 50)));
424 ASSERT_EQ(result, layer.SetTransform(kMatrix)); 428 ASSERT_EQ(result, layer.SetTransform(kMatrix));
425 ASSERT_EQ(result, layer.SetOpacity(128)); 429 ASSERT_EQ(result, layer.SetOpacity(128));
426 430
427 return std::string(); 431 return std::string();
428 } 432 }
429 433
430 434
OLDNEW
« no previous file with comments | « ppapi/shared_impl/compositor_layer_data.h ('k') | ppapi/thunk/ppb_compositor_layer_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698