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

Unified Diff: cc/test/test_web_graphics_context_3d.cc

Issue 1479673003: Verify resource provider sync tokens before sending to parent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test so it doesn't expect dummy fence sync Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_web_graphics_context_3d.cc
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc
index 96b11b4ae12f309e930bdc7604611cfee72794c4..8e4df91e20159fc35160be1a5596a8f5cd70dbff 100644
--- a/cc/test/test_web_graphics_context_3d.cc
+++ b/cc/test/test_web_graphics_context_3d.cc
@@ -69,7 +69,7 @@ TestWebGraphicsContext3D::TestWebGraphicsContext3D()
scale_factor_(-1.f),
test_support_(NULL),
last_update_type_(NO_UPDATE),
- next_insert_sync_point_(1),
+ next_insert_fence_sync_(1),
unpack_alignment_(4),
bound_buffer_(0),
weak_ptr_factory_(this) {
@@ -649,8 +649,20 @@ GLuint TestWebGraphicsContext3D::createGpuMemoryBufferImageCHROMIUM(
return image_id;
}
-unsigned TestWebGraphicsContext3D::insertSyncPoint() {
- return next_insert_sync_point_++;
+GLuint TestWebGraphicsContext3D::insertSyncPoint() {
+ return static_cast<GLuint>(next_insert_fence_sync_++);
+}
+
+GLuint64 TestWebGraphicsContext3D::insertFenceSync() {
+ return next_insert_fence_sync_++;
+}
+
+void TestWebGraphicsContext3D::genSyncToken(GLuint64 fence_sync,
+ GLbyte* sync_token) {
+ gpu::SyncToken sync_token_data(gpu::CommandBufferNamespace::GPU_IO, 0, 0,
+ fence_sync);
+ sync_token_data.SetVerifyFlush();
+ memcpy(sync_token, &sync_token_data, sizeof(sync_token_data));
}
void TestWebGraphicsContext3D::waitSyncToken(const GLbyte* sync_token) {
@@ -662,6 +674,16 @@ void TestWebGraphicsContext3D::waitSyncToken(const GLbyte* sync_token) {
}
}
+void TestWebGraphicsContext3D::verifySyncTokens(GLbyte** sync_tokens,
+ GLsizei count) {
+ for (GLsizei i = 0; i < count; ++i) {
+ gpu::SyncToken sync_token_data;
+ memcpy(sync_token_data.GetData(), sync_tokens[i], sizeof(sync_token_data));
+ sync_token_data.SetVerifyFlush();
+ memcpy(sync_tokens[i], &sync_token_data, sizeof(sync_token_data));
+ }
+}
+
size_t TestWebGraphicsContext3D::NumTextures() const {
base::AutoLock lock(namespace_->lock);
return namespace_->textures.Size();
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698