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 #ifndef PPAPI_TESTS_TEST_GRAPHICS_2D_H_ | 5 #ifndef PPAPI_TESTS_TEST_GRAPHICS_2D_H_ |
6 #define PPAPI_TESTS_TEST_GRAPHICS_2D_H_ | 6 #define PPAPI_TESTS_TEST_GRAPHICS_2D_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ppapi/c/pp_stdint.h" | 10 #include "ppapi/c/pp_stdint.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const pp::Rect& square, uint32_t square_color) const; | 59 const pp::Rect& square, uint32_t square_color) const; |
60 | 60 |
61 // Validates that the given device context is a single color with a square of | 61 // Validates that the given device context is a single color with a square of |
62 // another color inside it. | 62 // another color inside it. |
63 bool IsSquareInDC(const pp::Graphics2D& dc, uint32_t background_color, | 63 bool IsSquareInDC(const pp::Graphics2D& dc, uint32_t background_color, |
64 const pp::Rect& square, uint32_t square_color) const; | 64 const pp::Rect& square, uint32_t square_color) const; |
65 | 65 |
66 // Validates that the given device context is filled with the given color. | 66 // Validates that the given device context is filled with the given color. |
67 bool IsDCUniformColor(const pp::Graphics2D& dc, uint32_t color) const; | 67 bool IsDCUniformColor(const pp::Graphics2D& dc, uint32_t color) const; |
68 | 68 |
| 69 // Returns true if Graphics2D resource is created correctly. |
| 70 bool ResourceHealthCheck(pp::Instance* instance, pp::Graphics2D* context); |
| 71 bool ResourceHealthCheckForC(pp::Instance* instance, PP_Resource graphics_2d); |
| 72 |
69 // Issues a flush on the given device context and blocks until the flush | 73 // Issues a flush on the given device context and blocks until the flush |
70 // has issued its callback. Returns true on success. | 74 // has issued its callback. Returns true on success. |
71 bool FlushAndWaitForDone(pp::Graphics2D* context); | 75 bool FlushAndWaitForDone(pp::Graphics2D* context); |
72 | 76 |
73 // Creates an image and replaces the contents of the Graphics2D with the | 77 // Creates an image and replaces the contents of the Graphics2D with the |
74 // image, waiting for completion. This returns the resource ID of the image | 78 // image, waiting for completion. This returns the resource ID of the image |
75 // data we created. This image data will be released by the time the call | 79 // data we created. This image data will be released by the time the call |
76 // completes, but it can be used for comparisons later. | 80 // completes, but it can be used for comparisons later. |
77 // | 81 // |
78 // Returns 0 on failure. | 82 // Returns 0 on failure. |
(...skipping 13 matching lines...) Expand all Loading... |
92 std::string TestHumongous(); | 96 std::string TestHumongous(); |
93 std::string TestInitToZero(); | 97 std::string TestInitToZero(); |
94 std::string TestDescribe(); | 98 std::string TestDescribe(); |
95 std::string TestPaint(); | 99 std::string TestPaint(); |
96 std::string TestScroll(); | 100 std::string TestScroll(); |
97 std::string TestReplace(); | 101 std::string TestReplace(); |
98 std::string TestFlush(); | 102 std::string TestFlush(); |
99 std::string TestFlushOffscreenUpdate(); | 103 std::string TestFlushOffscreenUpdate(); |
100 std::string TestDev(); | 104 std::string TestDev(); |
101 std::string TestReplaceContentsCaching(); | 105 std::string TestReplaceContentsCaching(); |
| 106 std::string TestBindNull(); |
102 | 107 |
103 // Used by the tests that access the C API directly. | 108 // Used by the tests that access the C API directly. |
104 const PPB_Graphics2D* graphics_2d_interface_; | 109 const PPB_Graphics2D* graphics_2d_interface_; |
105 const PPB_ImageData* image_data_interface_; | 110 const PPB_ImageData* image_data_interface_; |
106 | 111 |
107 // Used to indicate that DidChangeView has happened, in order to make plugin | 112 // Used to indicate that DidChangeView has happened, in order to make plugin |
108 // and ui synchronous. | 113 // and ui synchronous. |
109 bool is_view_changed_; | 114 bool is_view_changed_; |
110 | 115 |
111 // Set to true to request that the next invocation of DidChangeView should | 116 // Set to true to request that the next invocation of DidChangeView should |
112 // post a quit to the message loop. DidChangeView will also reset the flag so | 117 // post a quit to the message loop. DidChangeView will also reset the flag so |
113 // this will only happen once. | 118 // this will only happen once. |
114 bool post_quit_on_view_changed_; | 119 bool post_quit_on_view_changed_; |
115 }; | 120 }; |
116 | 121 |
117 #endif // PPAPI_TESTS_TEST_GRAPHICS_2D_H_ | 122 #endif // PPAPI_TESTS_TEST_GRAPHICS_2D_H_ |
OLD | NEW |