| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "ui/gfx/compositor/compositor.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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 void Compositor::applyScrollAndScale(const WebKit::WebSize& scrollDelta, | 247 void Compositor::applyScrollAndScale(const WebKit::WebSize& scrollDelta, |
| 248 float scaleFactor) { | 248 float scaleFactor) { |
| 249 } | 249 } |
| 250 | 250 |
| 251 WebKit::WebGraphicsContext3D* Compositor::createContext3D() { | 251 WebKit::WebGraphicsContext3D* Compositor::createContext3D() { |
| 252 WebKit::WebGraphicsContext3D* context; | 252 WebKit::WebGraphicsContext3D* context; |
| 253 if (test_compositor_enabled) { | 253 if (test_compositor_enabled) { |
| 254 // Use context that results in no rendering to the screen. | 254 // Use context that results in no rendering to the screen. |
| 255 context = new TestWebGraphicsContext3D(); | 255 context = new TestWebGraphicsContext3D(); |
| 256 } else { | 256 } else { |
| 257 #if defined(OS_MACOSX) && !defined(USE_AURA) | |
| 258 // Non-Aura builds compile this code but doesn't call it. Unfortunately | |
| 259 // this is where we translate gfx::AcceleratedWidget to | |
| 260 // gfx::PluginWindowHandle, and they are different on non-Aura Mac. | |
| 261 // TODO(piman): remove ifdefs when AcceleratedWidget is rationalized on Mac. | |
| 262 NOTIMPLEMENTED(); | |
| 263 return NULL; | |
| 264 #else | |
| 265 gfx::GLShareGroup* share_group = | 257 gfx::GLShareGroup* share_group = |
| 266 SharedResources::GetInstance()->GetShareGroup(); | 258 SharedResources::GetInstance()->GetShareGroup(); |
| 267 context = new webkit::gpu::WebGraphicsContext3DInProcessImpl( | 259 context = new webkit::gpu::WebGraphicsContext3DInProcessImpl( |
| 268 widget_, share_group); | 260 widget_, share_group); |
| 269 #endif | |
| 270 } | 261 } |
| 271 WebKit::WebGraphicsContext3D::Attributes attrs; | 262 WebKit::WebGraphicsContext3D::Attributes attrs; |
| 272 context->initialize(attrs, 0, true); | 263 context->initialize(attrs, 0, true); |
| 273 | 264 |
| 274 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 265 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 275 if (!command_line->HasSwitch(switches::kDisableUIVsync)) { | 266 if (!command_line->HasSwitch(switches::kDisableUIVsync)) { |
| 276 context->makeContextCurrent(); | 267 context->makeContextCurrent(); |
| 277 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); | 268 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); |
| 278 gl_context->SetSwapInterval(1); | 269 gl_context->SetSwapInterval(1); |
| 279 gl_context->ReleaseCurrent(NULL); | 270 gl_context->ReleaseCurrent(NULL); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 switches::kDisableTestCompositor)) { | 318 switches::kDisableTestCompositor)) { |
| 328 test_compositor_enabled = true; | 319 test_compositor_enabled = true; |
| 329 } | 320 } |
| 330 } | 321 } |
| 331 | 322 |
| 332 COMPOSITOR_EXPORT void DisableTestCompositor() { | 323 COMPOSITOR_EXPORT void DisableTestCompositor() { |
| 333 test_compositor_enabled = false; | 324 test_compositor_enabled = false; |
| 334 } | 325 } |
| 335 | 326 |
| 336 } // namespace ui | 327 } // namespace ui |
| OLD | NEW |