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

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

Issue 7395020: Create new GLSurface for cross process image transport. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 9 years, 5 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/command_buffer/service/gpu_scheduler.cc
diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc
index 93651186713f2c12ae250da09f1688d5ac8c8d45..d34d75a9470625e635acb43f82074a4f568580f1 100644
--- a/gpu/command_buffer/service/gpu_scheduler.cc
+++ b/gpu/command_buffer/service/gpu_scheduler.cc
@@ -25,7 +25,7 @@ GpuScheduler::GpuScheduler(CommandBuffer* command_buffer,
: command_buffer_(command_buffer),
commands_per_update_(100),
unscheduled_count_(0),
-#if defined(OS_MACOSX) || defined(TOUCH_UI)
+#if defined(OS_MACOSX)
swap_buffers_count_(0),
acknowledged_swap_buffers_count_(0),
#endif
@@ -46,7 +46,7 @@ GpuScheduler::GpuScheduler(CommandBuffer* command_buffer,
: command_buffer_(command_buffer),
commands_per_update_(commands_per_update),
unscheduled_count_(0),
-#if defined(OS_MACOSX) || defined(TOUCH_UI)
+#if defined(OS_MACOSX)
swap_buffers_count_(0),
acknowledged_swap_buffers_count_(0),
#endif
@@ -72,7 +72,7 @@ bool GpuScheduler::InitializeCommon(
if (!context->MakeCurrent(surface))
return false;
-#if !defined(OS_MACOSX)
+#if !defined(OS_MACOSX) && !defined(TOUCH_UI)
// Set up swap interval for onscreen contexts.
if (!surface->IsOffscreen()) {
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableGpuVsync))
@@ -138,7 +138,7 @@ bool GpuScheduler::SetParent(GpuScheduler* parent_scheduler,
return decoder_->SetParent(NULL, 0);
}
-#if defined(OS_MACOSX) || defined(TOUCH_UI)
+#if defined(OS_MACOSX)
namespace {
const unsigned int kMaxOutstandingSwapBuffersCallsPerOnscreenContext = 1;
}
@@ -178,11 +178,6 @@ void GpuScheduler::ProcessCommands() {
#if defined(OS_MACOSX)
bool do_rate_limiting = surface_.get() != NULL;
-#elif defined(TOUCH_UI)
- bool do_rate_limiting = back_surface_.get() != NULL;
-#endif
-
-#if defined(OS_MACOSX) || defined(TOUCH_UI)
// Don't swamp the browser process with SwapBuffers calls it can't handle.
if (do_rate_limiting &&
swap_buffers_count_ - acknowledged_swap_buffers_count_ >=
@@ -295,10 +290,7 @@ void GpuScheduler::ResizeOffscreenFrameBuffer(const gfx::Size& size) {
}
void GpuScheduler::SetResizeCallback(Callback1<gfx::Size>::Type* callback) {
- wrapped_resize_callback_.reset(callback);
- decoder_->SetResizeCallback(
- NewCallback(this,
- &GpuScheduler::WillResize));
+ decoder_->SetResizeCallback(callback);
}
void GpuScheduler::SetSwapBuffersCallback(
@@ -326,10 +318,4 @@ void GpuScheduler::ScheduleProcessCommands() {
method_factory_.NewRunnableMethod(&GpuScheduler::ProcessCommands));
}
-void GpuScheduler::WillResize(gfx::Size size) {
- if (wrapped_resize_callback_.get()) {
- wrapped_resize_callback_->Run(size);
- }
-}
-
} // namespace gpu

Powered by Google App Engine
This is Rietveld 408576698