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

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

Issue 1817323003: Revert of Remove create/delete methods from WebGraphicsContext3D. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@complex-casts
Patch Set: Created 4 years, 9 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: third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
index 2909155514630ea517ca6e191c17146809c6f108..44fa3e381414d3e757a6a84ffe8486ac40a13164 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
@@ -168,33 +168,26 @@
memcpy(syncToken, &fenceSync, sizeof(fenceSync));
}
- void GenTextures(GLsizei n, GLuint* textures) override
- {
- static GLuint id = 1;
- for (GLsizei i = 0; i < n; ++i)
- textures[i] = id++;
- }
-
- GLuint boundTexture() const { return m_boundTexture; }
- GLuint boundTextureTarget() const { return m_boundTextureTarget; }
- GLuint mostRecentlyWaitedSyncToken() const { return m_mostRecentlyWaitedSyncToken; }
- GLuint currentImageId() const { return m_currentImageId; }
+ uint32_t boundTexture() const { return m_boundTexture; }
+ uint32_t boundTextureTarget() const { return m_boundTextureTarget; }
+ uint32_t mostRecentlyWaitedSyncToken() const { return m_mostRecentlyWaitedSyncToken; }
+ uint32_t currentImageId() const { return m_currentImageId; }
IntSize mostRecentlyProducedSize() const { return m_mostRecentlyProducedSize; }
bool allowImageChromium() const { return m_allowImageChromium; }
void setAllowImageChromium(bool allow) { m_allowImageChromium = allow; }
private:
- GLuint m_boundTexture = 0;
- GLuint m_boundTextureTarget = 0;
- GLuint m_mostRecentlyWaitedSyncToken = 0;
+ uint32_t m_boundTexture = 0;
+ uint32_t m_boundTextureTarget = 0;
+ uint32_t m_mostRecentlyWaitedSyncToken = 0;
WGC3Dbyte m_currentMailboxByte = 0;
IntSize m_mostRecentlyProducedSize;
bool m_allowImageChromium = true;
- GLuint m_currentImageId = 1;
- HashMap<GLuint, IntSize> m_textureSizes;
- HashMap<GLuint, IntSize> m_imageSizes;
- HashMap<GLuint, GLuint> m_imageToTextureMap;
+ uint32_t m_currentImageId = 1;
+ HashMap<uint32_t, IntSize> m_textureSizes;
+ HashMap<uint32_t, IntSize> m_imageSizes;
+ HashMap<uint32_t, uint32_t> m_imageToTextureMap;
};
class WebGraphicsContext3DForTests : public MockWebGraphicsContext3D {
@@ -625,29 +618,22 @@
}
}
- void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) override
- {
- for (GLsizei i = 0; i < n; ++i)
- renderbuffers[i] = m_nextGenRenderbufferId++;
- }
-
- GLuint stencilAttachment() const { return m_stencilAttachment; }
- GLuint depthAttachment() const { return m_depthAttachment; }
- GLuint depthStencilAttachment() const { return m_depthStencilAttachment; }
- size_t numAllocatedRenderBuffer() const { return m_nextGenRenderbufferId - 1; }
+ uint32_t stencilAttachment() const { return m_stencilAttachment; }
+ uint32_t depthAttachment() const { return m_depthAttachment; }
+ uint32_t depthStencilAttachment() const { return m_depthStencilAttachment; }
private:
- GLuint m_nextGenRenderbufferId = 1;
- GLuint m_depthAttachment = 0;
- GLuint m_stencilAttachment = 0;
- GLuint m_depthStencilAttachment = 0;
+ uint32_t m_depthAttachment = 0;
+ uint32_t m_stencilAttachment = 0;
+ uint32_t m_depthStencilAttachment = 0;
};
class DepthStencilTrackingContext : public MockWebGraphicsContext3D {
public:
+ DepthStencilTrackingContext() : m_nextRenderBufferId(1) {}
~DepthStencilTrackingContext() override {}
- size_t numAllocatedRenderBuffer() const { return m_contextGL.numAllocatedRenderBuffer(); }
+ int numAllocatedRenderBuffer() const { return m_nextRenderBufferId - 1; }
WebGLId stencilAttachment() const { return m_contextGL.stencilAttachment(); }
WebGLId depthAttachment() const { return m_contextGL.depthAttachment(); }
WebGLId depthStencilAttachment() const { return m_contextGL.depthStencilAttachment(); }
@@ -660,9 +646,15 @@
return WebString();
}
+ WebGLId createRenderbuffer() override
+ {
+ return ++m_nextRenderBufferId;
+ }
+
gpu::gles2::GLES2Interface* getGLES2Interface() override { return &m_contextGL; }
private:
+ WebGLId m_nextRenderBufferId;
DepthStencilTrackingGLES2Interface m_contextGL;
};
@@ -675,7 +667,7 @@
bool requestStencil;
bool requestDepth;
- size_t expectedRenderBuffers;
+ int expectedRenderBuffers;
const char* const testCaseName;
};

Powered by Google App Engine
This is Rietveld 408576698