summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authornduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-12 21:10:24 +0000
committernduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-12 21:10:24 +0000
commit652257791aa8aa96c53edd18edf2bd8c4dcaec1b (patch)
tree4f88b09862e79a8f6419d503641b943fe476f1ac /gpu
parenta1b621b3d14415485da5fc2f2df44f6dfcde84fd (diff)
downloadchromium_src-652257791aa8aa96c53edd18edf2bd8c4dcaec1b.zip
chromium_src-652257791aa8aa96c53edd18edf2bd8c4dcaec1b.tar.gz
chromium_src-652257791aa8aa96c53edd18edf2bd8c4dcaec1b.tar.bz2
Drive compositor scheduling with the swapbuffers callback.
This modifies the compositor to hold DoDeferredUpdate until the previous frames are ack'd by the GPU. This vastly improves rendering smoothness. There is some complexity in the way we intercept the SwapBuffers callback due to the different types of GraphicsContexts that get scheduled by render_widget. BUG=80480,53051 Review URL: http://codereview.chromium.org/6902106 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85186 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/client/gles2_implementation.h1
-rw-r--r--gpu/command_buffer/service/feature_info.cc4
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc8
3 files changed, 7 insertions, 6 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 6104802..36f7dee2 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -349,4 +349,3 @@ class GLES2Implementation {
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_
-
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index 61514a8..3ed88ad 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -108,6 +108,7 @@ void FeatureInfo::AddFeatures(const char* desired_features) {
AddExtensionString("GL_CHROMIUM_resize");
AddExtensionString("GL_CHROMIUM_strict_attribs");
AddExtensionString("GL_CHROMIUM_latch");
+ AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback");
// Only turn this feature on if it is requested. Not by default.
if (desired_features && ext.Desire("GL_CHROMIUM_webglsl")) {
@@ -349,6 +350,3 @@ void FeatureInfo::AddExtensionString(const std::string& str) {
} // namespace gles2
} // namespace gpu
-
-
-
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index ccaf5c3..3167ceb 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1478,6 +1478,8 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
// failed texImage2D call should be ignored.
bool tex_image_2d_failed_;
+ int frame_number_;
+
DISALLOW_COPY_AND_ASSIGN(GLES2DecoderImpl);
};
@@ -1803,7 +1805,8 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group)
use_shader_translator_(true),
validators_(group_->feature_info()->validators()),
feature_info_(group_->feature_info()),
- tex_image_2d_failed_(false) {
+ tex_image_2d_failed_(false),
+ frame_number_(0) {
attrib_0_value_.v[0] = 0.0f;
attrib_0_value_.v[1] = 0.0f;
attrib_0_value_.v[2] = 0.0f;
@@ -6360,7 +6363,8 @@ error::Error GLES2DecoderImpl::HandleSwapBuffers(
return error::kNoError;
}
} else {
- TRACE_EVENT0("gpu", "GLContext::SwapBuffers");
+ TRACE_EVENT1("gpu", "GLContext::SwapBuffers", "frame", frame_number_);
+ frame_number_++;
if (!context_->SwapBuffers()) {
LOG(ERROR) << "Context lost because SwapBuffers failed.";
return error::kLostContext;