| 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 "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "gpu/command_buffer/service/shader_translator.h" | 52 #include "gpu/command_buffer/service/shader_translator.h" |
| 53 #include "gpu/command_buffer/service/shader_translator_cache.h" | 53 #include "gpu/command_buffer/service/shader_translator_cache.h" |
| 54 #include "gpu/command_buffer/service/stream_texture.h" | 54 #include "gpu/command_buffer/service/stream_texture.h" |
| 55 #include "gpu/command_buffer/service/stream_texture_manager.h" | 55 #include "gpu/command_buffer/service/stream_texture_manager.h" |
| 56 #include "gpu/command_buffer/service/texture_manager.h" | 56 #include "gpu/command_buffer/service/texture_manager.h" |
| 57 #include "gpu/command_buffer/service/vertex_array_manager.h" | 57 #include "gpu/command_buffer/service/vertex_array_manager.h" |
| 58 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | 58 #include "gpu/command_buffer/service/vertex_attrib_manager.h" |
| 59 #include "ui/gl/gl_bindings.h" | 59 #include "ui/gl/gl_bindings.h" |
| 60 #include "ui/gl/gl_fence.h" | 60 #include "ui/gl/gl_fence.h" |
| 61 #include "ui/gl/gl_image.h" | 61 #include "ui/gl/gl_image.h" |
| 62 #include "ui/gl/gl_image_egl.h" |
| 62 #include "ui/gl/gl_implementation.h" | 63 #include "ui/gl/gl_implementation.h" |
| 63 #include "ui/gl/gl_surface.h" | 64 #include "ui/gl/gl_surface.h" |
| 64 | 65 |
| 66 #include "ui/gfx/ozone/surface_factory_ozone.h" |
| 67 |
| 65 #if defined(OS_MACOSX) | 68 #if defined(OS_MACOSX) |
| 66 #include "ui/gl/io_surface_support_mac.h" | 69 #include "ui/gl/io_surface_support_mac.h" |
| 67 #endif | 70 #endif |
| 68 | 71 |
| 69 #if defined(OS_WIN) | 72 #if defined(OS_WIN) |
| 70 #include "base/win/win_util.h" | 73 #include "base/win/win_util.h" |
| 71 #endif | 74 #endif |
| 72 | 75 |
| 73 // TODO(zmo): we can't include "City.h" due to type def conflicts. | 76 // TODO(zmo): we can't include "City.h" due to type def conflicts. |
| 74 extern uint64 CityHash64(const char*, size_t); | 77 extern uint64 CityHash64(const char*, size_t); |
| (...skipping 7394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7469 is_offscreen ? offscreen_size_ : surface_->GetSize()); | 7472 is_offscreen ? offscreen_size_ : surface_->GetSize()); |
| 7470 } | 7473 } |
| 7471 if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height)) { | 7474 if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height)) { |
| 7472 return error::kNoError; | 7475 return error::kNoError; |
| 7473 } else { | 7476 } else { |
| 7474 LOG(ERROR) << "Context lost because PostSubBuffer failed."; | 7477 LOG(ERROR) << "Context lost because PostSubBuffer failed."; |
| 7475 return error::kLostContext; | 7478 return error::kLostContext; |
| 7476 } | 7479 } |
| 7477 } | 7480 } |
| 7478 | 7481 |
| 7482 error::Error GLES2DecoderImpl::HandleSetOverlayPlaneCHROMIUM( |
| 7483 uint32 immediate_data_size, |
| 7484 const cmds::SetOverlayPlaneCHROMIUM& c) { |
| 7485 gfx::SurfaceFactoryOzone* factory = gfx::SurfaceFactoryOzone::GetInstance(); |
| 7486 |
| 7487 TextureRef* ref = texture_manager()->GetTexture(c.texture_id); |
| 7488 gfx::GLImage* image = |
| 7489 ref->texture()->GetLevelImage(ref->texture()->target(), 0); |
| 7490 if (!image) { |
| 7491 return error::kNoError; |
| 7492 } |
| 7493 gfx::GLImageEGL* egl_image = static_cast<gfx::GLImageEGL*>(image); |
| 7494 gfx::Rect display_rect(c.x, c.y, c.width, c.height); |
| 7495 factory->SetOverlayPlane(1, |
| 7496 reinterpret_cast<gfx::AcceleratedWidget>( |
| 7497 egl_image->buffer_.native_buffer), |
| 7498 display_rect); |
| 7499 return error::kNoError; |
| 7500 } |
| 7501 |
| 7479 error::Error GLES2DecoderImpl::GetAttribLocationHelper( | 7502 error::Error GLES2DecoderImpl::GetAttribLocationHelper( |
| 7480 GLuint client_id, uint32 location_shm_id, uint32 location_shm_offset, | 7503 GLuint client_id, uint32 location_shm_id, uint32 location_shm_offset, |
| 7481 const std::string& name_str) { | 7504 const std::string& name_str) { |
| 7482 if (!StringIsValidForGLES(name_str.c_str())) { | 7505 if (!StringIsValidForGLES(name_str.c_str())) { |
| 7483 LOCAL_SET_GL_ERROR( | 7506 LOCAL_SET_GL_ERROR( |
| 7484 GL_INVALID_VALUE, "glGetAttribLocation", "Invalid character"); | 7507 GL_INVALID_VALUE, "glGetAttribLocation", "Invalid character"); |
| 7485 return error::kNoError; | 7508 return error::kNoError; |
| 7486 } | 7509 } |
| 7487 Program* program = GetProgramInfoNotShader( | 7510 Program* program = GetProgramInfoNotShader( |
| 7488 client_id, "glGetAttribLocation"); | 7511 client_id, "glGetAttribLocation"); |
| (...skipping 3152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10641 DoDidUseTexImageIfNeeded(texture, texture->target()); | 10664 DoDidUseTexImageIfNeeded(texture, texture->target()); |
| 10642 } | 10665 } |
| 10643 | 10666 |
| 10644 // Include the auto-generated part of this file. We split this because it means | 10667 // Include the auto-generated part of this file. We split this because it means |
| 10645 // we can easily edit the non-auto generated parts right here in this file | 10668 // we can easily edit the non-auto generated parts right here in this file |
| 10646 // instead of having to edit some template or the code generator. | 10669 // instead of having to edit some template or the code generator. |
| 10647 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10670 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 10648 | 10671 |
| 10649 } // namespace gles2 | 10672 } // namespace gles2 |
| 10650 } // namespace gpu | 10673 } // namespace gpu |
| OLD | NEW |