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

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

Issue 8060045: Use shared D3D9 texture to transport the compositor's backing buffer to the browser... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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
OLDNEW
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_gl.h" 5 #include "ui/gfx/compositor/compositor_gl.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 gfx::GLSurface* surface) { 307 gfx::GLSurface* surface) {
308 if (initialized_) 308 if (initialized_)
309 return gfx::GLContext::CreateGLContext( 309 return gfx::GLContext::CreateGLContext(
310 context_->share_group(), 310 context_->share_group(),
311 surface, 311 surface,
312 gfx::PreferIntegratedGpu); 312 gfx::PreferIntegratedGpu);
313 else 313 else
314 return NULL; 314 return NULL;
315 } 315 }
316 316
317 void* SharedResources::GetDisplay() {
318 return surface_->GetDisplay();
319 }
320
317 TextureGL::TextureGL() : texture_id_(0) { 321 TextureGL::TextureGL() : texture_id_(0) {
318 } 322 }
319 323
320 TextureGL::TextureGL(const gfx::Size& size) : texture_id_(0), size_(size) { 324 TextureGL::TextureGL(const gfx::Size& size) : texture_id_(0), size_(size) {
321 } 325 }
322 326
323 TextureGL::~TextureGL() { 327 TextureGL::~TextureGL() {
324 if (texture_id_) { 328 if (texture_id_) {
325 SharedResources* instance = SharedResources::GetInstance(); 329 SharedResources* instance = SharedResources::GetInstance();
326 DCHECK(instance); 330 DCHECK(instance);
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 Compositor* Compositor::Create(CompositorDelegate* owner, 548 Compositor* Compositor::Create(CompositorDelegate* owner,
545 gfx::AcceleratedWidget widget, 549 gfx::AcceleratedWidget widget,
546 const gfx::Size& size) { 550 const gfx::Size& size) {
547 if (SharedResources::GetInstance() == NULL) 551 if (SharedResources::GetInstance() == NULL)
548 return NULL; 552 return NULL;
549 else 553 else
550 return new CompositorGL(owner, widget, size); 554 return new CompositorGL(owner, widget, size);
551 } 555 }
552 556
553 } // namespace ui 557 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698