| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 virtual GLHelper* GetGLHelper() OVERRIDE { | 81 virtual GLHelper* GetGLHelper() OVERRIDE { |
| 82 return NULL; | 82 return NULL; |
| 83 } | 83 } |
| 84 | 84 |
| 85 virtual uint32 InsertSyncPoint() OVERRIDE { | 85 virtual uint32 InsertSyncPoint() OVERRIDE { |
| 86 return 0; | 86 return 0; |
| 87 } | 87 } |
| 88 | 88 |
| 89 void WaitSyncPoint(uint32 sync_point) OVERRIDE { |
| 90 } |
| 91 |
| 89 // We don't generate lost context events, so we don't need to keep track of | 92 // We don't generate lost context events, so we don't need to keep track of |
| 90 // observers | 93 // observers |
| 91 virtual void AddObserver(ImageTransportFactoryObserver* observer) OVERRIDE { | 94 virtual void AddObserver(ImageTransportFactoryObserver* observer) OVERRIDE { |
| 92 } | 95 } |
| 93 | 96 |
| 94 virtual void RemoveObserver( | 97 virtual void RemoveObserver( |
| 95 ImageTransportFactoryObserver* observer) OVERRIDE { | 98 ImageTransportFactoryObserver* observer) OVERRIDE { |
| 96 } | 99 } |
| 97 | 100 |
| 98 private: | 101 private: |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } | 461 } |
| 459 return gl_helper_.get(); | 462 return gl_helper_.get(); |
| 460 } | 463 } |
| 461 | 464 |
| 462 virtual uint32 InsertSyncPoint() OVERRIDE { | 465 virtual uint32 InsertSyncPoint() OVERRIDE { |
| 463 if (!shared_contexts_main_thread_) | 466 if (!shared_contexts_main_thread_) |
| 464 return 0; | 467 return 0; |
| 465 return shared_contexts_main_thread_->Context3d()->insertSyncPoint(); | 468 return shared_contexts_main_thread_->Context3d()->insertSyncPoint(); |
| 466 } | 469 } |
| 467 | 470 |
| 471 virtual void WaitSyncPoint(uint32 sync_point) OVERRIDE { |
| 472 if (!shared_contexts_main_thread_) |
| 473 return; |
| 474 shared_contexts_main_thread_->Context3d()->waitSyncPoint(sync_point); |
| 475 } |
| 476 |
| 468 virtual void AddObserver(ImageTransportFactoryObserver* observer) OVERRIDE { | 477 virtual void AddObserver(ImageTransportFactoryObserver* observer) OVERRIDE { |
| 469 observer_list_.AddObserver(observer); | 478 observer_list_.AddObserver(observer); |
| 470 } | 479 } |
| 471 | 480 |
| 472 virtual void RemoveObserver( | 481 virtual void RemoveObserver( |
| 473 ImageTransportFactoryObserver* observer) OVERRIDE { | 482 ImageTransportFactoryObserver* observer) OVERRIDE { |
| 474 observer_list_.RemoveObserver(observer); | 483 observer_list_.RemoveObserver(observer); |
| 475 } | 484 } |
| 476 | 485 |
| 477 void OnLostContext(ui::Compositor* compositor) { | 486 void OnLostContext(ui::Compositor* compositor) { |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 delete g_factory; | 693 delete g_factory; |
| 685 g_factory = NULL; | 694 g_factory = NULL; |
| 686 } | 695 } |
| 687 | 696 |
| 688 // static | 697 // static |
| 689 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 698 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
| 690 return g_factory; | 699 return g_factory; |
| 691 } | 700 } |
| 692 | 701 |
| 693 } // namespace content | 702 } // namespace content |
| OLD | NEW |