| 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/tests/test_graphics_2d.h" | 5 #include "ppapi/tests/test_graphics_2d.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 pp::Graphics2D dc(instance_, pp::Size(w, h), false); | 559 pp::Graphics2D dc(instance_, pp::Size(w, h), false); |
| 560 ASSERT_FALSE(dc.is_null()); | 560 ASSERT_FALSE(dc.is_null()); |
| 561 | 561 |
| 562 // Replacing with a different size image should fail. | 562 // Replacing with a different size image should fail. |
| 563 pp::ImageData weird_size(instance_, PP_IMAGEDATAFORMAT_BGRA_PREMUL, | 563 pp::ImageData weird_size(instance_, PP_IMAGEDATAFORMAT_BGRA_PREMUL, |
| 564 pp::Size(w - 1, h), true); | 564 pp::Size(w - 1, h), true); |
| 565 ASSERT_FALSE(weird_size.is_null()); | 565 ASSERT_FALSE(weird_size.is_null()); |
| 566 dc.ReplaceContents(&weird_size); | 566 dc.ReplaceContents(&weird_size); |
| 567 | 567 |
| 568 // Fill the background with blue but don't flush yet. | 568 // Fill the background with blue but don't flush yet. |
| 569 const int32_t background_color = 0xFF0000FF; | 569 const uint32_t background_color = 0xFF0000FF; |
| 570 pp::ImageData background(instance_, PP_IMAGEDATAFORMAT_BGRA_PREMUL, | 570 pp::ImageData background(instance_, PP_IMAGEDATAFORMAT_BGRA_PREMUL, |
| 571 pp::Size(w, h), true); | 571 pp::Size(w, h), true); |
| 572 ASSERT_FALSE(background.is_null()); | 572 ASSERT_FALSE(background.is_null()); |
| 573 FillRectInImage(&background, pp::Rect(0, 0, w, h), background_color); | 573 FillRectInImage(&background, pp::Rect(0, 0, w, h), background_color); |
| 574 dc.PaintImageData(background, pp::Point(0, 0)); | 574 dc.PaintImageData(background, pp::Point(0, 0)); |
| 575 | 575 |
| 576 // Replace with a green background but don't flush yet. | 576 // Replace with a green background but don't flush yet. |
| 577 const int32_t swapped_color = 0x00FF00FF; | 577 const int32_t swapped_color = 0x00FF00FF; |
| 578 pp::ImageData swapped(instance_, PP_IMAGEDATAFORMAT_BGRA_PREMUL, | 578 pp::ImageData swapped(instance_, PP_IMAGEDATAFORMAT_BGRA_PREMUL, |
| 579 pp::Size(w, h), true); | 579 pp::Size(w, h), true); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 pp::Graphics2D dc(instance_, pp::Size(w, h), false); | 796 pp::Graphics2D dc(instance_, pp::Size(w, h), false); |
| 797 ASSERT_FALSE(dc.is_null()); | 797 ASSERT_FALSE(dc.is_null()); |
| 798 ASSERT_TRUE(instance_->BindGraphics(dc)); | 798 ASSERT_TRUE(instance_->BindGraphics(dc)); |
| 799 | 799 |
| 800 ASSERT_TRUE(instance_->BindGraphics(pp::Graphics2D())); | 800 ASSERT_TRUE(instance_->BindGraphics(pp::Graphics2D())); |
| 801 ASSERT_TRUE(instance_->BindGraphics(pp::Graphics3D())); | 801 ASSERT_TRUE(instance_->BindGraphics(pp::Graphics3D())); |
| 802 | 802 |
| 803 PASS(); | 803 PASS(); |
| 804 } | 804 } |
| 805 | 805 |
| OLD | NEW |