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

Unified Diff: gpu/command_buffer/service/feature_info.cc

Issue 8566041: Allow GLSurface to indicate that it supports a specific extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gpu_unittests. Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/feature_info.cc
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index 64c7222d66c7493f1abe73a2f3b9c21fc6d97638..6b26b911324fd47fa6f26d59b537d3904278cf5e 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -6,8 +6,8 @@
#include <string>
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/gl_utils.h"
+#include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_implementation.h"
-#include "ui/gfx/gl/gl_surface.h"
namespace gpu {
namespace gles2 {
@@ -97,7 +97,11 @@ bool FeatureInfo::Initialize(const DisallowedFeatures& disallowed_features,
void FeatureInfo::AddFeatures(const char* desired_features) {
// Figure out what extensions to turn on.
ExtensionHelper ext(
- reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)),
+ // Some unittests execute without a context made current
+ // so fall back to glGetString
+ gfx::GLContext::GetCurrent() ?
+ gfx::GLContext::GetCurrent()->GetExtensions().c_str() :
+ reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)),
desired_features);
bool npot_ok = false;
@@ -359,9 +363,7 @@ void FeatureInfo::AddFeatures(const char* desired_features) {
enable_texture_half_float_linear;
feature_flags_.npot_ok = npot_ok;
- if (ext.Desire("GL_CHROMIUM_post_sub_buffer") &&
- gfx::GLSurface::GetCurrent() &&
- gfx::GLSurface::GetCurrent()->SupportsPostSubBuffer()) {
+ if (ext.HaveAndDesire("GL_CHROMIUM_post_sub_buffer")) {
AddExtensionString("GL_CHROMIUM_post_sub_buffer");
}
}
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698