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 "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" | 5 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
6 | 6 |
7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
8 #ifndef GL_GLEXT_PROTOTYPES | 8 #ifndef GL_GLEXT_PROTOTYPES |
9 #define GL_GLEXT_PROTOTYPES 1 | 9 #define GL_GLEXT_PROTOTYPES 1 |
10 #endif | 10 #endif |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 void LoseContext(uint32 current, uint32 other); | 151 void LoseContext(uint32 current, uint32 other); |
152 | 152 |
153 void SetSignalSyncPointCallback( | 153 void SetSignalSyncPointCallback( |
154 scoped_ptr< | 154 scoped_ptr< |
155 WebKit::WebGraphicsContext3D::WebGraphicsSyncPointCallback> callback); | 155 WebKit::WebGraphicsContext3D::WebGraphicsSyncPointCallback> callback); |
156 | 156 |
157 CommandBufferService* GetCommandBufferService(); | 157 CommandBufferService* GetCommandBufferService(); |
158 | 158 |
159 ::gpu::gles2::GLES2Decoder* GetDecoder(); | 159 ::gpu::gles2::GLES2Decoder* GetDecoder(); |
160 | 160 |
161 void OnResizeView(gfx::Size size); | 161 void OnResizeView(gfx::Size size, float scale_factor); |
162 | 162 |
163 private: | 163 private: |
164 explicit GLInProcessContext(bool share_resources); | 164 explicit GLInProcessContext(bool share_resources); |
165 | 165 |
166 bool Initialize(bool is_offscreen, | 166 bool Initialize(bool is_offscreen, |
167 gfx::AcceleratedWidget window, | 167 gfx::AcceleratedWidget window, |
168 const gfx::Size& size, | 168 const gfx::Size& size, |
169 const char* allowed_extensions, | 169 const char* allowed_extensions, |
170 const int32* attrib_list, | 170 const int32* attrib_list, |
171 gfx::GpuPreference gpu_preference); | 171 gfx::GpuPreference gpu_preference); |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 } | 482 } |
483 | 483 |
484 CommandBufferService* GLInProcessContext::GetCommandBufferService() { | 484 CommandBufferService* GLInProcessContext::GetCommandBufferService() { |
485 return command_buffer_.get(); | 485 return command_buffer_.get(); |
486 } | 486 } |
487 | 487 |
488 ::gpu::gles2::GLES2Decoder* GLInProcessContext::GetDecoder() { | 488 ::gpu::gles2::GLES2Decoder* GLInProcessContext::GetDecoder() { |
489 return decoder_.get(); | 489 return decoder_.get(); |
490 } | 490 } |
491 | 491 |
492 void GLInProcessContext::OnResizeView(gfx::Size size) { | 492 void GLInProcessContext::OnResizeView(gfx::Size size, float scale_factor) { |
493 DCHECK(!surface_->IsOffscreen()); | 493 DCHECK(!surface_->IsOffscreen()); |
494 surface_->Resize(size); | 494 surface_->Resize(size); |
495 } | 495 } |
496 | 496 |
497 // TODO(gman): Remove This | 497 // TODO(gman): Remove This |
498 void GLInProcessContext::DisableShaderTranslation() { | 498 void GLInProcessContext::DisableShaderTranslation() { |
499 NOTREACHED(); | 499 NOTREACHED(); |
500 } | 500 } |
501 | 501 |
502 GLES2Implementation* GLInProcessContext::GetImplementation() { | 502 GLES2Implementation* GLInProcessContext::GetImplementation() { |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 } | 965 } |
966 | 966 |
967 void WebGraphicsContext3DInProcessCommandBufferImpl::reshapeWithScaleFactor( | 967 void WebGraphicsContext3DInProcessCommandBufferImpl::reshapeWithScaleFactor( |
968 int width, int height, float scale_factor) { | 968 int width, int height, float scale_factor) { |
969 cached_width_ = width; | 969 cached_width_ = width; |
970 cached_height_ = height; | 970 cached_height_ = height; |
971 | 971 |
972 // TODO(gmam): See if we can comment this in. | 972 // TODO(gmam): See if we can comment this in. |
973 // ClearContext(); | 973 // ClearContext(); |
974 | 974 |
975 gl_->ResizeCHROMIUM(width, height); | 975 gl_->ResizeCHROMIUM(width, height, scale_factor); |
976 } | 976 } |
977 | 977 |
978 WebGLId WebGraphicsContext3DInProcessCommandBufferImpl::createCompositorTexture( | 978 WebGLId WebGraphicsContext3DInProcessCommandBufferImpl::createCompositorTexture( |
979 WGC3Dsizei width, WGC3Dsizei height) { | 979 WGC3Dsizei width, WGC3Dsizei height) { |
980 // TODO(gmam): See if we can comment this in. | 980 // TODO(gmam): See if we can comment this in. |
981 // ClearContext(); | 981 // ClearContext(); |
982 return context_->CreateParentTexture(gfx::Size(width, height)); | 982 return context_->CreateParentTexture(gfx::Size(width, height)); |
983 } | 983 } |
984 | 984 |
985 void WebGraphicsContext3DInProcessCommandBufferImpl::deleteCompositorTexture( | 985 void WebGraphicsContext3DInProcessCommandBufferImpl::deleteCompositorTexture( |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2003 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM, | 2003 DELEGATE_TO_GL_1(waitAsyncTexImage2DCHROMIUM, WaitAsyncTexImage2DCHROMIUM, |
2004 WGC3Denum) | 2004 WGC3Denum) |
2005 | 2005 |
2006 void WebGraphicsContext3DInProcessCommandBufferImpl::SetGpuMemoryBufferCreator( | 2006 void WebGraphicsContext3DInProcessCommandBufferImpl::SetGpuMemoryBufferCreator( |
2007 GpuMemoryBufferCreator* creator) { | 2007 GpuMemoryBufferCreator* creator) { |
2008 g_gpu_memory_buffer_creator = creator; | 2008 g_gpu_memory_buffer_creator = creator; |
2009 } | 2009 } |
2010 | 2010 |
2011 } // namespace gpu | 2011 } // namespace gpu |
2012 } // namespace webkit | 2012 } // namespace webkit |
OLD | NEW |