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

Side by Side Diff: ui/gfx/compositor/compositor_cc.cc

Issue 9141034: Always use webkit compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix shared build Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/test/content_test_suite.cc ('k') | ui/gfx/compositor/compositor_setup.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 257
258 void CompositorCC::applyScrollDelta(const WebKit::WebSize&) { 258 void CompositorCC::applyScrollDelta(const WebKit::WebSize&) {
259 } 259 }
260 260
261 WebKit::WebGraphicsContext3D* CompositorCC::createContext3D() { 261 WebKit::WebGraphicsContext3D* CompositorCC::createContext3D() {
262 WebKit::WebGraphicsContext3D* context; 262 WebKit::WebGraphicsContext3D* context;
263 if (test_compositor_enabled) { 263 if (test_compositor_enabled) {
264 // Use context that results in no rendering to the screen. 264 // Use context that results in no rendering to the screen.
265 context = new TestWebGraphicsContext3D(); 265 context = new TestWebGraphicsContext3D();
266 } else { 266 } else {
267 #if defined(OS_MACOSX) && !defined(USE_AURA)
268 // Non-Aura builds compile this code but doesn't call it. Unfortunately
269 // this is where we translate gfx::AcceleratedWidget to
270 // gfx::PluginWindowHandle, and they are different on non-Aura Mac.
271 // TODO(piman): remove ifdefs when AcceleratedWidget is rationalized on Mac.
272 NOTIMPLEMENTED();
273 return NULL;
274 #else
267 gfx::GLShareGroup* share_group = 275 gfx::GLShareGroup* share_group =
268 SharedResourcesCC::GetInstance()->GetShareGroup(); 276 SharedResourcesCC::GetInstance()->GetShareGroup();
269 context = new webkit::gpu::WebGraphicsContext3DInProcessImpl( 277 context = new webkit::gpu::WebGraphicsContext3DInProcessImpl(
270 widget_, share_group); 278 widget_, share_group);
279 #endif
271 } 280 }
272 WebKit::WebGraphicsContext3D::Attributes attrs; 281 WebKit::WebGraphicsContext3D::Attributes attrs;
273 context->initialize(attrs, 0, true); 282 context->initialize(attrs, 0, true);
274 283
275 CommandLine* command_line = CommandLine::ForCurrentProcess(); 284 CommandLine* command_line = CommandLine::ForCurrentProcess();
276 if (!command_line->HasSwitch(switches::kDisableUIVsync)) { 285 if (!command_line->HasSwitch(switches::kDisableUIVsync)) {
277 context->makeContextCurrent(); 286 context->makeContextCurrent();
278 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); 287 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent();
279 gl_context->SetSwapInterval(1); 288 gl_context->SetSwapInterval(1);
280 gl_context->ReleaseCurrent(NULL); 289 gl_context->ReleaseCurrent(NULL);
(...skipping 24 matching lines...) Expand all
305 switches::kDisableTestCompositor)) { 314 switches::kDisableTestCompositor)) {
306 test_compositor_enabled = true; 315 test_compositor_enabled = true;
307 } 316 }
308 } 317 }
309 318
310 COMPOSITOR_EXPORT void DisableTestCompositor() { 319 COMPOSITOR_EXPORT void DisableTestCompositor() {
311 test_compositor_enabled = false; 320 test_compositor_enabled = false;
312 } 321 }
313 322
314 } // namespace ui 323 } // namespace ui
OLDNEW
« no previous file with comments | « content/test/content_test_suite.cc ('k') | ui/gfx/compositor/compositor_setup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698