| 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 "content/browser/renderer_host/image_transport_factory.h" | 5 #include "content/browser/renderer_host/image_transport_factory.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 return NULL; | 455 return NULL; |
| 456 scoped_refptr<OwnedTexture> image(new OwnedTexture( | 456 scoped_refptr<OwnedTexture> image(new OwnedTexture( |
| 457 shared_contexts_main_thread_->Context3d(), | 457 shared_contexts_main_thread_->Context3d(), |
| 458 size, | 458 size, |
| 459 device_scale_factor, | 459 device_scale_factor, |
| 460 texture_id)); | 460 texture_id)); |
| 461 return image; | 461 return image; |
| 462 } | 462 } |
| 463 | 463 |
| 464 virtual GLHelper* GetGLHelper() OVERRIDE { | 464 virtual GLHelper* GetGLHelper() OVERRIDE { |
| 465 if (!gl_helper_.get()) { | 465 if (!gl_helper_) { |
| 466 CreateSharedContextLazy(); | 466 CreateSharedContextLazy(); |
| 467 WebGraphicsContext3DCommandBufferImpl* context_for_main_thread = | 467 WebGraphicsContext3DCommandBufferImpl* context_for_main_thread = |
| 468 shared_contexts_main_thread_->Context3d(); | 468 shared_contexts_main_thread_->Context3d(); |
| 469 gl_helper_.reset(new GLHelper(context_for_main_thread)); | 469 gl_helper_.reset(new GLHelper(context_for_main_thread)); |
| 470 } | 470 } |
| 471 return gl_helper_.get(); | 471 return gl_helper_.get(); |
| 472 } | 472 } |
| 473 | 473 |
| 474 virtual uint32 InsertSyncPoint() OVERRIDE { | 474 virtual uint32 InsertSyncPoint() OVERRIDE { |
| 475 if (!shared_contexts_main_thread_) | 475 if (!shared_contexts_main_thread_) |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 delete g_factory; | 760 delete g_factory; |
| 761 g_factory = NULL; | 761 g_factory = NULL; |
| 762 } | 762 } |
| 763 | 763 |
| 764 // static | 764 // static |
| 765 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 765 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
| 766 return g_factory; | 766 return g_factory; |
| 767 } | 767 } |
| 768 | 768 |
| 769 } // namespace content | 769 } // namespace content |
| OLD | NEW |