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_android.h" | 5 #include "content/browser/renderer_host/image_transport_factory_android.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
10 #include "content/common/gpu/client/gl_helper.h" | 10 #include "content/common/gpu/client/gl_helper.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 scoped_ptr<GLHelper> gl_helper_; | 48 scoped_ptr<GLHelper> gl_helper_; |
49 | 49 |
50 DISALLOW_COPY_AND_ASSIGN(CmdBufferImageTransportFactory); | 50 DISALLOW_COPY_AND_ASSIGN(CmdBufferImageTransportFactory); |
51 }; | 51 }; |
52 | 52 |
53 CmdBufferImageTransportFactory::CmdBufferImageTransportFactory() { | 53 CmdBufferImageTransportFactory::CmdBufferImageTransportFactory() { |
54 BrowserGpuChannelHostFactory* factory = | 54 BrowserGpuChannelHostFactory* factory = |
55 BrowserGpuChannelHostFactory::instance(); | 55 BrowserGpuChannelHostFactory::instance(); |
56 scoped_refptr<GpuChannelHost> gpu_channel_host(factory->EstablishGpuChannelSyn
c( | 56 scoped_refptr<GpuChannelHost> gpu_channel_host(factory->EstablishGpuChannelSyn
c( |
57 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); | 57 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); |
58 DCHECK(gpu_channel_host); | 58 DCHECK(gpu_channel_host.get()); |
59 | 59 |
60 blink::WebGraphicsContext3D::Attributes attrs; | 60 blink::WebGraphicsContext3D::Attributes attrs; |
61 attrs.shareResources = true; | 61 attrs.shareResources = true; |
62 GURL url("chrome://gpu/ImageTransportFactoryAndroid"); | 62 GURL url("chrome://gpu/ImageTransportFactoryAndroid"); |
63 static const size_t kBytesPerPixel = 4; | 63 static const size_t kBytesPerPixel = 4; |
64 gfx::DeviceDisplayInfo display_info; | 64 gfx::DeviceDisplayInfo display_info; |
65 size_t full_screen_texture_size_in_bytes = display_info.GetDisplayHeight() * | 65 size_t full_screen_texture_size_in_bytes = display_info.GetDisplayHeight() * |
66 display_info.GetDisplayWidth() * | 66 display_info.GetDisplayWidth() * |
67 kBytesPerPixel; | 67 kBytesPerPixel; |
68 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; | 68 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 void GLContextLostListener::DidLoseContext() { | 152 void GLContextLostListener::DidLoseContext() { |
153 delete g_factory; | 153 delete g_factory; |
154 g_factory = NULL; | 154 g_factory = NULL; |
155 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver, | 155 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver, |
156 g_factory_observers.Get(), | 156 g_factory_observers.Get(), |
157 OnLostResources()); | 157 OnLostResources()); |
158 } | 158 } |
159 | 159 |
160 } // namespace content | 160 } // namespace content |
OLD | NEW |