| 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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_.get()) { |
| 466 CreateSharedContextLazy(); | 466 CreateSharedContextLazy(); |
| 467 WebKit::WebGraphicsContext3D* context_for_main_thread = | 467 WebKit::WebGraphicsContext3D* context_for_main_thread = |
| 468 shared_contexts_main_thread_->Context3d(); | 468 shared_contexts_main_thread_->Context3d(); |
| 469 WebKit::WebGraphicsContext3D* context_for_thread = | 469 gl_helper_.reset(new GLHelper(context_for_main_thread)); |
| 470 CreateOffscreenContext(); | |
| 471 if (!context_for_thread) | |
| 472 return NULL; | |
| 473 | |
| 474 gl_helper_.reset(new GLHelper(context_for_main_thread, | |
| 475 context_for_thread)); | |
| 476 } | 470 } |
| 477 return gl_helper_.get(); | 471 return gl_helper_.get(); |
| 478 } | 472 } |
| 479 | 473 |
| 480 virtual uint32 InsertSyncPoint() OVERRIDE { | 474 virtual uint32 InsertSyncPoint() OVERRIDE { |
| 481 if (!shared_contexts_main_thread_) | 475 if (!shared_contexts_main_thread_) |
| 482 return 0; | 476 return 0; |
| 483 return shared_contexts_main_thread_->Context3d()->insertSyncPoint(); | 477 return shared_contexts_main_thread_->Context3d()->insertSyncPoint(); |
| 484 } | 478 } |
| 485 | 479 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 delete g_factory; | 759 delete g_factory; |
| 766 g_factory = NULL; | 760 g_factory = NULL; |
| 767 } | 761 } |
| 768 | 762 |
| 769 // static | 763 // static |
| 770 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 764 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
| 771 return g_factory; | 765 return g_factory; |
| 772 } | 766 } |
| 773 | 767 |
| 774 } // namespace content | 768 } // namespace content |
| OLD | NEW |