Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2473973002: NOT for review (for discussion): Query IOSurfaceIsInUse in the browser process
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 1022
1023 void DoDrawBuffersEXT(GLsizei count, const volatile GLenum* bufs); 1023 void DoDrawBuffersEXT(GLsizei count, const volatile GLenum* bufs);
1024 1024
1025 void DoLoseContextCHROMIUM(GLenum current, GLenum other); 1025 void DoLoseContextCHROMIUM(GLenum current, GLenum other);
1026 1026
1027 void DoFlushDriverCachesCHROMIUM(void); 1027 void DoFlushDriverCachesCHROMIUM(void);
1028 1028
1029 void DoMatrixLoadfCHROMIUM(GLenum matrix_mode, 1029 void DoMatrixLoadfCHROMIUM(GLenum matrix_mode,
1030 const volatile GLfloat* matrix); 1030 const volatile GLfloat* matrix);
1031 void DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode); 1031 void DoMatrixLoadIdentityCHROMIUM(GLenum matrix_mode);
1032 void DoScheduleCALayerInUseQueryCHROMIUM(GLsizei count, 1032 void DoScheduleCALayerInUseQueryCHROMIUM(
1033 const volatile GLuint* textures); 1033 GLsizei count,
1034 const volatile GLuint* textures_and_handle_requests);
1034 1035
1035 void DoFlushMappedBufferRange( 1036 void DoFlushMappedBufferRange(
1036 GLenum target, GLintptr offset, GLsizeiptr size); 1037 GLenum target, GLintptr offset, GLsizeiptr size);
1037 1038
1038 // Creates a Program for the given program. 1039 // Creates a Program for the given program.
1039 Program* CreateProgram(GLuint client_id, GLuint service_id) { 1040 Program* CreateProgram(GLuint client_id, GLuint service_id) {
1040 return program_manager()->CreateProgram(client_id, service_id); 1041 return program_manager()->CreateProgram(client_id, service_id);
1041 } 1042 }
1042 1043
1043 // Gets the program info for the given program. Returns NULL if none exists. 1044 // Gets the program info for the given program. Returns NULL if none exists.
(...skipping 10640 matching lines...) Expand 10 before | Expand all | Expand 10 after
11684 ca_layer_shared_state_->opacity, filter); 11685 ca_layer_shared_state_->opacity, filter);
11685 if (!surface_->ScheduleCALayer(params)) { 11686 if (!surface_->ScheduleCALayer(params)) {
11686 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM", 11687 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM",
11687 "failed to schedule CALayer"); 11688 "failed to schedule CALayer");
11688 } 11689 }
11689 return error::kNoError; 11690 return error::kNoError;
11690 } 11691 }
11691 11692
11692 void GLES2DecoderImpl::DoScheduleCALayerInUseQueryCHROMIUM( 11693 void GLES2DecoderImpl::DoScheduleCALayerInUseQueryCHROMIUM(
11693 GLsizei count, 11694 GLsizei count,
11694 const volatile GLuint* textures) { 11695 const volatile GLuint* textures_and_handle_requests) {
11695 std::vector<gl::GLSurface::CALayerInUseQuery> queries; 11696 std::vector<gl::GLSurface::CALayerInUseQuery> queries;
11696 queries.reserve(count); 11697 queries.reserve(count);
11697 for (GLsizei i = 0; i < count; ++i) { 11698 for (GLsizei i = 0; i < count; ++i) {
11698 gl::GLImage* image = nullptr; 11699 gl::GLImage* image = nullptr;
11699 GLuint texture_id = textures[i]; 11700 GLuint texture_id = textures_and_handle_requests[2 * i];
11701 bool needs_handle = textures_and_handle_requests[2 * i + 1];
11700 if (texture_id) { 11702 if (texture_id) {
11701 TextureRef* ref = texture_manager()->GetTexture(texture_id); 11703 TextureRef* ref = texture_manager()->GetTexture(texture_id);
11702 if (!ref) { 11704 if (!ref) {
11703 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, 11705 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE,
11704 "glScheduleCALayerInUseQueryCHROMIUM", 11706 "glScheduleCALayerInUseQueryCHROMIUM",
11705 "unknown texture"); 11707 "unknown texture");
11708 // TODO(ccameron): If this hit, then our accounting in the
11709 // browser process will be messed up. We should always add
11710 // requested queries.
11706 return; 11711 return;
11707 } 11712 }
11708 Texture::ImageState image_state; 11713 Texture::ImageState image_state;
11709 image = ref->texture()->GetLevelImage(ref->texture()->target(), 0, 11714 image = ref->texture()->GetLevelImage(ref->texture()->target(), 0,
11710 &image_state); 11715 &image_state);
11711 } 11716 }
11712 gl::GLSurface::CALayerInUseQuery query; 11717 gl::GLSurface::CALayerInUseQuery query;
11713 query.image = image; 11718 query.image = image;
11714 query.texture = texture_id; 11719 query.texture = texture_id;
11720 query.needs_gpu_memory_buffer_handle = needs_handle;
11715 queries.push_back(query); 11721 queries.push_back(query);
11716 } 11722 }
11717 11723
11718 surface_->ScheduleCALayerInUseQuery(std::move(queries)); 11724 surface_->ScheduleCALayerInUseQuery(std::move(queries));
11719 } 11725 }
11720 11726
11721 error::Error GLES2DecoderImpl::GetAttribLocationHelper( 11727 error::Error GLES2DecoderImpl::GetAttribLocationHelper(
11722 GLuint client_id, 11728 GLuint client_id,
11723 uint32_t location_shm_id, 11729 uint32_t location_shm_id,
11724 uint32_t location_shm_offset, 11730 uint32_t location_shm_offset,
(...skipping 7058 matching lines...) Expand 10 before | Expand all | Expand 10 after
18783 } 18789 }
18784 18790
18785 // Include the auto-generated part of this file. We split this because it means 18791 // Include the auto-generated part of this file. We split this because it means
18786 // we can easily edit the non-auto generated parts right here in this file 18792 // we can easily edit the non-auto generated parts right here in this file
18787 // instead of having to edit some template or the code generator. 18793 // instead of having to edit some template or the code generator.
18788 #include "base/macros.h" 18794 #include "base/macros.h"
18789 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 18795 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
18790 18796
18791 } // namespace gles2 18797 } // namespace gles2
18792 } // namespace gpu 18798 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/texture_in_use_response.h ('k') | gpu/ipc/client/gpu_memory_buffer_impl_io_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698