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

Unified Diff: cc/output/gl_renderer_unittest.cc

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Folded sync_point into sync_tokens Created 5 years, 2 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
Index: cc/output/gl_renderer_unittest.cc
diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc
index 6d80d81228e5b67db86d5aa4da9886b479f18e1d..15e01b00692fed7b44ece28dc34d7e2de85fa242 100644
--- a/cc/output/gl_renderer_unittest.cc
+++ b/cc/output/gl_renderer_unittest.cc
@@ -929,7 +929,7 @@ class TextureStateTrackingContext : public TestWebGraphicsContext3D {
test_capabilities_.gpu.egl_image_external = true;
}
- MOCK_METHOD1(waitSyncPoint, void(unsigned sync_point));
+ MOCK_METHOD1(waitSyncToken, void(const GLbyte* sync_token));
MOCK_METHOD3(texParameteri, void(GLenum target, GLenum pname, GLint param));
MOCK_METHOD4(drawElements,
void(GLenum mode, GLsizei count, GLenum type, GLintptr offset));
@@ -973,7 +973,7 @@ TEST_F(GLRendererTest, ActiveTextureState) {
RenderPass* root_pass =
AddRenderPass(&render_passes_in_draw_order_, RenderPassId(1, 1),
gfx::Rect(100, 100), gfx::Transform());
- uint32_t mailbox_sync_point;
+ unsigned mailbox_sync_point;
AddOneOfEveryQuadType(root_pass, resource_provider.get(), RenderPassId(0, 0),
&mailbox_sync_point);
@@ -987,7 +987,9 @@ TEST_F(GLRendererTest, ActiveTextureState) {
// The sync points for all quads are waited on first. This sync point is
// for a texture quad drawn later in the frame.
- EXPECT_CALL(*context, waitSyncPoint(mailbox_sync_point)).Times(1);
+ gpu::SyncToken mailbox_sync_token(mailbox_sync_point);
+ EXPECT_CALL(*context, waitSyncToken(mailbox_sync_token.GetConstData()))
+ .Times(1);
// yuv_quad is drawn with the default linear filter.
EXPECT_CALL(*context, drawElements(_, _, _, _));
@@ -2023,10 +2025,9 @@ class TestOverlayProcessor : public OverlayProcessor {
Strategy* strategy_;
};
-void MailboxReleased(unsigned sync_point,
+void MailboxReleased(const gpu::SyncToken& sync_token,
bool lost_resource,
- BlockingTaskRunner* main_thread_task_runner) {
-}
+ BlockingTaskRunner* main_thread_task_runner) {}
void IgnoreCopyResult(scoped_ptr<CopyOutputResult> result) {
}
@@ -2063,9 +2064,8 @@ TEST_F(GLRendererTest, DontOverlayWithCopyRequests) {
root_pass->copy_requests.push_back(
CopyOutputRequest::CreateRequest(base::Bind(&IgnoreCopyResult)));
- unsigned sync_point = 0;
TextureMailbox mailbox =
- TextureMailbox(gpu::Mailbox::Generate(), GL_TEXTURE_2D, sync_point,
+ TextureMailbox(gpu::Mailbox::Generate(), gpu::SyncToken(), GL_TEXTURE_2D,
gfx::Size(256, 256), true);
scoped_ptr<SingleReleaseCallbackImpl> release_callback =
SingleReleaseCallbackImpl::Create(base::Bind(&MailboxReleased));
@@ -2139,9 +2139,9 @@ class SingleOverlayOnTopProcessor : public OverlayProcessor {
SingleOverlayValidator validator_;
};
-class WaitSyncPointCountingContext : public TestWebGraphicsContext3D {
+class WaitSyncTokenCountingContext : public TestWebGraphicsContext3D {
public:
- MOCK_METHOD1(waitSyncPoint, void(unsigned sync_point));
+ MOCK_METHOD1(waitSyncToken, void(const GLbyte* sync_Token));
piman 2015/10/29 00:08:20 nit: sync_token
David Yen 2015/10/29 17:08:08 Done.
};
class MockOverlayScheduler {
@@ -2154,10 +2154,10 @@ class MockOverlayScheduler {
const gfx::RectF& uv_rect));
};
-TEST_F(GLRendererTest, OverlaySyncPointsAreProcessed) {
- scoped_ptr<WaitSyncPointCountingContext> context_owned(
- new WaitSyncPointCountingContext);
- WaitSyncPointCountingContext* context = context_owned.get();
+TEST_F(GLRendererTest, OverlaySyncTokensAreProcessed) {
+ scoped_ptr<WaitSyncTokenCountingContext> context_owned(
+ new WaitSyncTokenCountingContext);
+ WaitSyncTokenCountingContext* context = context_owned.get();
MockOverlayScheduler overlay_scheduler;
scoped_refptr<TestContextProvider> context_provider =
@@ -2193,9 +2193,9 @@ TEST_F(GLRendererTest, OverlaySyncPointsAreProcessed) {
viewport_rect, gfx::Transform());
root_pass->has_transparent_background = false;
- unsigned sync_point = 29;
+ gpu::SyncToken sync_token(29);
TextureMailbox mailbox =
- TextureMailbox(gpu::Mailbox::Generate(), GL_TEXTURE_2D, sync_point,
+ TextureMailbox(gpu::Mailbox::Generate(), sync_token, GL_TEXTURE_2D,
gfx::Size(256, 256), true);
scoped_ptr<SingleReleaseCallbackImpl> release_callback =
SingleReleaseCallbackImpl::Create(base::Bind(&MailboxReleased));
@@ -2220,7 +2220,7 @@ TEST_F(GLRendererTest, OverlaySyncPointsAreProcessed) {
// Verify that overlay_quad actually gets turned into an overlay, and even
// though it's not drawn, that its sync point is waited on.
- EXPECT_CALL(*context, waitSyncPoint(sync_point)).Times(1);
+ EXPECT_CALL(*context, waitSyncToken(sync_token.GetConstData())).Times(1);
EXPECT_CALL(overlay_scheduler,
Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect,
BoundingRect(uv_top_left, uv_bottom_right))).Times(1);

Powered by Google App Engine
This is Rietveld 408576698