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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 2664123003: gl_gl_api_implementation: Check API type instead of null fnptr (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_gl_api_implementation.cc
diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
index cc4453ea910464274308768dfb8a9dcc9e77dc71..ecd5881e5c607a067e910a0ac23979c9be967a76 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -437,20 +437,29 @@ void RealGLApi::glDrawElementsFn(GLenum mode,
}
void RealGLApi::glClearDepthFn(GLclampd depth) {
- if (driver_->fn.glClearDepthFn) {
- GLApiBase::glClearDepthFn(depth);
- } else {
+ // OpenGL ES only has glClearDepthf, forward the parameters from glClearDepth.
+ // Many mock tests expect only glClearDepth is called so don't make the
+ // interception when testing with mocks.
+ if (version_->is_es && GetGLImplementation() != kGLImplementationMockGL) {
DCHECK(driver_->fn.glClearDepthfFn);
GLApiBase::glClearDepthfFn(static_cast<GLclampf>(depth));
+ } else {
+ DCHECK(driver_->fn.glClearDepthFn);
+ GLApiBase::glClearDepthFn(depth);
}
}
void RealGLApi::glDepthRangeFn(GLclampd z_near, GLclampd z_far) {
- if (driver_->fn.glDepthRangeFn) {
- GLApiBase::glDepthRangeFn(z_near, z_far);
- } else {
+ // OpenGL ES only has glDepthRangef, forward the parameters from glDepthRange.
+ // Many mock tests expect only glDepthRange is called so don't make the
+ // interception when testing with mocks.
+ if (version_->is_es && GetGLImplementation() != kGLImplementationMockGL) {
+ DCHECK(driver_->fn.glDepthRangefFn);
GLApiBase::glDepthRangefFn(static_cast<GLclampf>(z_near),
static_cast<GLclampf>(z_far));
+ } else {
+ DCHECK(driver_->fn.glDepthRangeFn);
+ GLApiBase::glDepthRangeFn(z_near, z_far);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698