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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp

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: Fix mock gpu video accelerator factory Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 { 88 {
89 return m_mostRecentlyProducedSize; 89 return m_mostRecentlyProducedSize;
90 } 90 }
91 91
92 unsigned insertSyncPoint() override 92 unsigned insertSyncPoint() override
93 { 93 {
94 static unsigned syncPointGenerator = 0; 94 static unsigned syncPointGenerator = 0;
95 return ++syncPointGenerator; 95 return ++syncPointGenerator;
96 } 96 }
97 97
98 void waitSyncPoint(unsigned syncPoint) override 98 void waitSyncPoint(unsigned syncPoint, const WGC3Dbyte* syncToken) override
99 { 99 {
100 m_mostRecentlyWaitedSyncPoint = syncPoint; 100 m_mostRecentlyWaitedSyncPoint = syncPoint;
101 if (syncToken) {
102 memcpy(m_mostRecentlyWaitedSyncToken, syncToken,
103 sizeof(m_mostRecentlyWaitedSyncToken));
104 }
101 } 105 }
102 106
103 WGC3Duint createGpuMemoryBufferImageCHROMIUM(WGC3Dsizei width, WGC3Dsizei he ight, WGC3Denum internalformat, WGC3Denum usage) override 107 WGC3Duint createGpuMemoryBufferImageCHROMIUM(WGC3Dsizei width, WGC3Dsizei he ight, WGC3Denum internalformat, WGC3Denum usage) override
104 { 108 {
105 m_imageSizes.set(m_currentImageId, IntSize(width, height)); 109 m_imageSizes.set(m_currentImageId, IntSize(width, height));
106 return m_currentImageId++; 110 return m_currentImageId++;
107 } 111 }
108 112
109 MOCK_METHOD1(destroyImageMock, void(WGC3Duint imageId)); 113 MOCK_METHOD1(destroyImageMock, void(WGC3Duint imageId));
110 void destroyImageCHROMIUM(WGC3Duint imageId) 114 void destroyImageCHROMIUM(WGC3Duint imageId)
(...skipping 23 matching lines...) Expand all
134 m_imageToTextureMap.remove(imageId); 138 m_imageToTextureMap.remove(imageId);
135 releaseTexImage2DMock(imageId); 139 releaseTexImage2DMock(imageId);
136 } 140 }
137 } 141 }
138 142
139 unsigned mostRecentlyWaitedSyncPoint() 143 unsigned mostRecentlyWaitedSyncPoint()
140 { 144 {
141 return m_mostRecentlyWaitedSyncPoint; 145 return m_mostRecentlyWaitedSyncPoint;
142 } 146 }
143 147
148 const WGC3Dbyte* mostRecentlyWaitedSyncToken()
149 {
150 return m_mostRecentlyWaitedSyncToken;
151 }
152
144 WGC3Duint nextImageIdToBeCreated() 153 WGC3Duint nextImageIdToBeCreated()
145 { 154 {
146 return m_currentImageId; 155 return m_currentImageId;
147 } 156 }
148 157
149 private: 158 private:
150 WebGLId m_boundTexture; 159 WebGLId m_boundTexture;
151 HashMap<WebGLId, IntSize> m_textureSizes; 160 HashMap<WebGLId, IntSize> m_textureSizes;
152 WGC3Dbyte m_currentMailboxByte; 161 WGC3Dbyte m_currentMailboxByte;
153 IntSize m_mostRecentlyProducedSize; 162 IntSize m_mostRecentlyProducedSize;
154 unsigned m_mostRecentlyWaitedSyncPoint; 163 unsigned m_mostRecentlyWaitedSyncPoint;
164 WGC3Dbyte m_mostRecentlyWaitedSyncToken[24];
Justin Novosad 2015/10/27 19:24:15 24 -> GL_SYNC_TOKEN_SIZE_CHROMIUM
David Yen 2015/10/28 22:03:43 Changed so this is no longer relevant.
155 WGC3Duint m_currentImageId; 165 WGC3Duint m_currentImageId;
156 HashMap<WGC3Duint, IntSize> m_imageSizes; 166 HashMap<WGC3Duint, IntSize> m_imageSizes;
157 HashMap<WGC3Duint, WebGLId> m_imageToTextureMap; 167 HashMap<WGC3Duint, WebGLId> m_imageToTextureMap;
158 }; 168 };
159 169
160 static const int initialWidth = 100; 170 static const int initialWidth = 100;
161 static const int initialHeight = 100; 171 static const int initialHeight = 100;
162 static const int alternateHeight = 50; 172 static const int alternateHeight = 50;
163 173
164 class DrawingBufferForTests : public DrawingBuffer { 174 class DrawingBufferForTests : public DrawingBuffer {
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 mailbox.syncPoint = waitSyncPoint; 668 mailbox.syncPoint = waitSyncPoint;
659 m_drawingBuffer->setIsHidden(true); 669 m_drawingBuffer->setIsHidden(true);
660 m_drawingBuffer->mailboxReleased(mailbox); 670 m_drawingBuffer->mailboxReleased(mailbox);
661 // m_drawingBuffer deletes mailbox immediately when hidden. 671 // m_drawingBuffer deletes mailbox immediately when hidden.
662 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint()); 672 EXPECT_EQ(waitSyncPoint, webContext()->mostRecentlyWaitedSyncPoint());
663 673
664 m_drawingBuffer->beginDestruction(); 674 m_drawingBuffer->beginDestruction();
665 } 675 }
666 676
667 } // namespace blink 677 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698