Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gfx/compositor/compositor_cc.h" | 5 #include "ui/gfx/compositor/compositor_cc.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "third_party/skia/include/images/SkImageEncoder.h" | 8 #include "third_party/skia/include/images/SkImageEncoder.h" |
| 9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 266 if (!command_line->HasSwitch(switches::kDisableUIVsync)) { | 266 if (!command_line->HasSwitch(switches::kDisableUIVsync)) { |
| 267 context->makeContextCurrent(); | 267 context->makeContextCurrent(); |
| 268 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); | 268 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); |
| 269 gl_context->SetSwapInterval(1); | 269 gl_context->SetSwapInterval(1); |
| 270 gl_context->ReleaseCurrent(NULL); | 270 gl_context->ReleaseCurrent(NULL); |
| 271 } | 271 } |
| 272 | 272 |
| 273 return context; | 273 return context; |
| 274 } | 274 } |
| 275 | 275 |
| 276 void CompositorCC::didCompleteSwapBuffers() { | |
| 277 Compositor::ScheduleDraw(); | |
|
piman
2012/01/03 22:35:54
I don't understand why we're doing this here. It s
pkotwicz
2012/01/03 22:42:18
Compositor::ScheduleDraw is pretty much the same a
| |
| 278 } | |
| 279 | |
| 276 void CompositorCC::didRebindGraphicsContext(bool success) { | 280 void CompositorCC::didRebindGraphicsContext(bool success) { |
| 277 } | 281 } |
| 278 | 282 |
| 279 void CompositorCC::scheduleComposite() { | 283 void CompositorCC::scheduleComposite() { |
| 280 ScheduleDraw(); | 284 ScheduleDraw(); |
| 281 } | 285 } |
| 282 | 286 |
| 283 void CompositorCC::notifyNeedsComposite() { | 287 void CompositorCC::notifyNeedsComposite() { |
| 284 ScheduleDraw(); | 288 ScheduleDraw(); |
| 285 } | 289 } |
| 286 | 290 |
| 287 Compositor* Compositor::Create(CompositorDelegate* owner, | 291 Compositor* Compositor::Create(CompositorDelegate* owner, |
| 288 gfx::AcceleratedWidget widget, | 292 gfx::AcceleratedWidget widget, |
| 289 const gfx::Size& size) { | 293 const gfx::Size& size) { |
| 290 return new CompositorCC(owner, widget, size); | 294 return new CompositorCC(owner, widget, size); |
| 291 } | 295 } |
| 292 | 296 |
| 293 COMPOSITOR_EXPORT void SetupTestCompositor() { | 297 COMPOSITOR_EXPORT void SetupTestCompositor() { |
| 294 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 298 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 295 switches::kDisableTestCompositor)) { | 299 switches::kDisableTestCompositor)) { |
| 296 test_compositor_enabled = true; | 300 test_compositor_enabled = true; |
| 297 } | 301 } |
| 298 } | 302 } |
| 299 | 303 |
| 300 COMPOSITOR_EXPORT void DisableTestCompositor() { | 304 COMPOSITOR_EXPORT void DisableTestCompositor() { |
| 301 test_compositor_enabled = false; | 305 test_compositor_enabled = false; |
| 302 } | 306 } |
| 303 | 307 |
| 304 } // namespace ui | 308 } // namespace ui |
| OLD | NEW |