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 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
6 | 6 |
7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 2849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2860 } | 2860 } |
2861 const MappedTexture& mt = it->second; | 2861 const MappedTexture& mt = it->second; |
2862 helper_->TexSubImage2D( | 2862 helper_->TexSubImage2D( |
2863 mt.target, mt.level, mt.xoffset, mt.yoffset, mt.width, mt.height, | 2863 mt.target, mt.level, mt.xoffset, mt.yoffset, mt.width, mt.height, |
2864 mt.format, mt.type, mt.shm_id, mt.shm_offset, GL_FALSE); | 2864 mt.format, mt.type, mt.shm_id, mt.shm_offset, GL_FALSE); |
2865 mapped_memory_->FreePendingToken(mt.shm_memory, helper_->InsertToken()); | 2865 mapped_memory_->FreePendingToken(mt.shm_memory, helper_->InsertToken()); |
2866 mapped_textures_.erase(it); | 2866 mapped_textures_.erase(it); |
2867 CheckGLError(); | 2867 CheckGLError(); |
2868 } | 2868 } |
2869 | 2869 |
2870 void GLES2Implementation::ResizeCHROMIUM(GLuint width, GLuint height) { | 2870 void GLES2Implementation::ResizeCHROMIUM(GLuint width, GLuint height, |
| 2871 float scale_factor) { |
2871 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 2872 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
2872 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glResizeCHROMIUM(" | 2873 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glResizeCHROMIUM(" |
2873 << width << ", " << height << ")"); | 2874 << width << ", " << height << ", " << scale_factor << ")"); |
2874 helper_->ResizeCHROMIUM(width, height); | 2875 helper_->ResizeCHROMIUM(width, height, scale_factor); |
2875 CheckGLError(); | 2876 CheckGLError(); |
2876 } | 2877 } |
2877 | 2878 |
2878 const GLchar* GLES2Implementation::GetRequestableExtensionsCHROMIUM() { | 2879 const GLchar* GLES2Implementation::GetRequestableExtensionsCHROMIUM() { |
2879 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 2880 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
2880 GPU_CLIENT_LOG("[" << GetLogPrefix() | 2881 GPU_CLIENT_LOG("[" << GetLogPrefix() |
2881 << "] glGetRequestableExtensionsCHROMIUM()"); | 2882 << "] glGetRequestableExtensionsCHROMIUM()"); |
2882 TRACE_EVENT0("gpu", | 2883 TRACE_EVENT0("gpu", |
2883 "GLES2Implementation::GetRequestableExtensionsCHROMIUM()"); | 2884 "GLES2Implementation::GetRequestableExtensionsCHROMIUM()"); |
2884 const char* result = NULL; | 2885 const char* result = NULL; |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3858 CheckGLError(); | 3859 CheckGLError(); |
3859 } | 3860 } |
3860 | 3861 |
3861 // Include the auto-generated part of this file. We split this because it means | 3862 // Include the auto-generated part of this file. We split this because it means |
3862 // we can easily edit the non-auto generated parts right here in this file | 3863 // we can easily edit the non-auto generated parts right here in this file |
3863 // instead of having to edit some template or the code generator. | 3864 // instead of having to edit some template or the code generator. |
3864 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 3865 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
3865 | 3866 |
3866 } // namespace gles2 | 3867 } // namespace gles2 |
3867 } // namespace gpu | 3868 } // namespace gpu |
OLD | NEW |