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

Unified Diff: gpu/blink/webgraphicscontext3d_impl.cc

Issue 1814573002: Move flush id from WebGraphicsContext3DImpl to GLES2Implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lastflush: . 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: gpu/blink/webgraphicscontext3d_impl.cc
diff --git a/gpu/blink/webgraphicscontext3d_impl.cc b/gpu/blink/webgraphicscontext3d_impl.cc
index d260e942c536192f2c29d1c3aeee56eb208548a8..33e86f71e3f2ee069c8e97f4110a0f7c79d21a87 100644
--- a/gpu/blink/webgraphicscontext3d_impl.cc
+++ b/gpu/blink/webgraphicscontext3d_impl.cc
@@ -42,18 +42,6 @@ using blink::WGC3Dsync;
namespace gpu_blink {
-namespace {
-
-uint32_t GenFlushID() {
- static base::subtle::Atomic32 flush_id = 0;
-
- base::subtle::Atomic32 my_id = base::subtle::Barrier_AtomicIncrement(
- &flush_id, 1);
- return static_cast<uint32_t>(my_id);
-}
-
-} // namespace anonymous
-
class WebGraphicsContext3DErrorMessageCallback
: public ::gpu::gles2::GLES2ImplementationErrorMessageCallback {
public:
@@ -198,9 +186,7 @@ WebGraphicsContext3DImpl::WebGraphicsContext3DImpl()
initialize_failed_(false),
context_lost_callback_(0),
error_message_callback_(0),
- gl_(NULL),
- flush_id_(0) {
-}
+ gl_(NULL) {}
WebGraphicsContext3DImpl::~WebGraphicsContext3DImpl() {
@@ -213,9 +199,7 @@ void WebGraphicsContext3DImpl::synthesizeGLError(WGC3Denum error) {
}
}
-uint32_t WebGraphicsContext3DImpl::lastFlushID() {
- return flush_id_;
-}
+DELEGATE_TO_GL_R(lastFlushID, GetLastFlushIdCHROMIUM, WebGLId)
DELEGATE_TO_GL_R(insertFenceSyncCHROMIUM, InsertFenceSyncCHROMIUM, WGC3Duint64)
@@ -373,15 +357,8 @@ DELEGATE_TO_GL_1(enable, Enable, WGC3Denum)
DELEGATE_TO_GL_1(enableVertexAttribArray, EnableVertexAttribArray,
WGC3Duint)
-void WebGraphicsContext3DImpl::finish() {
- flush_id_ = GenFlushID();
- gl_->Finish();
-}
-
-void WebGraphicsContext3DImpl::flush() {
- flush_id_ = GenFlushID();
- gl_->Flush();
-}
+DELEGATE_TO_GL(finish, Finish)
+DELEGATE_TO_GL(flush, Flush)
DELEGATE_TO_GL_4(framebufferRenderbuffer, FramebufferRenderbuffer,
WGC3Denum, WGC3Denum, WGC3Denum, WebGLId)
@@ -893,15 +870,8 @@ DELEGATE_TO_GL_11(copySubTextureCHROMIUM,
DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM,
WebGLId, WGC3Dint, const WGC3Dchar*)
-void WebGraphicsContext3DImpl::shallowFlushCHROMIUM() {
- flush_id_ = GenFlushID();
- gl_->ShallowFlushCHROMIUM();
-}
-
-void WebGraphicsContext3DImpl::shallowFinishCHROMIUM() {
- flush_id_ = GenFlushID();
- gl_->ShallowFinishCHROMIUM();
-}
+DELEGATE_TO_GL(shallowFlushCHROMIUM, ShallowFlushCHROMIUM)
+DELEGATE_TO_GL(shallowFinishCHROMIUM, ShallowFinishCHROMIUM)
void WebGraphicsContext3DImpl::loseContextCHROMIUM(
WGC3Denum current, WGC3Denum other) {

Powered by Google App Engine
This is Rietveld 408576698