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 29 matching lines...) Expand all Loading... |
108 // and ui synchronous. | 112 // and ui synchronous. |
109 bool is_view_changed_; | 113 bool is_view_changed_; |
110 | 114 |
111 // Set to true to request that the next invocation of DidChangeView should | 115 // 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 | 116 // post a quit to the message loop. DidChangeView will also reset the flag so |
113 // this will only happen once. | 117 // this will only happen once. |
114 bool post_quit_on_view_changed_; | 118 bool post_quit_on_view_changed_; |
115 }; | 119 }; |
116 | 120 |
117 #endif // PPAPI_TESTS_TEST_GRAPHICS_2D_H_ | 121 #endif // PPAPI_TESTS_TEST_GRAPHICS_2D_H_ |
OLD | NEW |