| 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/renderer/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 if (!shared_offscreen_context_ || | 889 if (!shared_offscreen_context_ || |
| 890 shared_offscreen_context_->DestroyedOnMainThread()) { | 890 shared_offscreen_context_->DestroyedOnMainThread()) { |
| 891 shared_offscreen_context_ = | 891 shared_offscreen_context_ = |
| 892 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 892 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 893 } | 893 } |
| 894 if (!shared_offscreen_context_) | 894 if (!shared_offscreen_context_) |
| 895 return NULL; | 895 return NULL; |
| 896 return shared_offscreen_context_->Context3d(); | 896 return shared_offscreen_context_->Context3d(); |
| 897 } | 897 } |
| 898 | 898 |
| 899 WebKit::WebCompositorSupport* |
| 900 RendererWebKitPlatformSupportImpl::compositorSupport() { |
| 901 return &compositor_support_; |
| 902 } |
| 903 |
| 899 //------------------------------------------------------------------------------ | 904 //------------------------------------------------------------------------------ |
| 900 | 905 |
| 901 GrContext* RendererWebKitPlatformSupportImpl::sharedOffscreenGrContext() { | 906 GrContext* RendererWebKitPlatformSupportImpl::sharedOffscreenGrContext() { |
| 902 if (!shared_offscreen_context_) | 907 if (!shared_offscreen_context_) |
| 903 return NULL; | 908 return NULL; |
| 904 return shared_offscreen_context_->GrContext(); | 909 return shared_offscreen_context_->GrContext(); |
| 905 } | 910 } |
| 906 | 911 |
| 907 //------------------------------------------------------------------------------ | 912 //------------------------------------------------------------------------------ |
| 908 | 913 |
| 909 WebKit::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: | 914 WebKit::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: |
| 910 createSharedOffscreenGraphicsContext3DProvider() { | 915 createSharedOffscreenGraphicsContext3DProvider() { |
| 911 if (!shared_offscreen_context_ || | 916 if (!shared_offscreen_context_ || |
| 912 shared_offscreen_context_->DestroyedOnMainThread()) { | 917 shared_offscreen_context_->DestroyedOnMainThread()) { |
| 913 shared_offscreen_context_ = | 918 shared_offscreen_context_ = |
| 914 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 919 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 915 } | 920 } |
| 916 return new webkit::gpu::WebGraphicsContext3DProviderImpl( | 921 return new webkit::gpu::WebGraphicsContext3DProviderImpl( |
| 917 shared_offscreen_context_); | 922 shared_offscreen_context_); |
| 918 } | 923 } |
| 919 | 924 |
| 920 } // namespace content | 925 } // namespace content |
| OLD | NEW |