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

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

Issue 13746002: Force GPU switch with CGLSetVirtualScreen only for compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate reiew feedback Created 7 years, 8 months 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 | Annotate | Revision Log
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 <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
11 #include <map> 11 #include <map>
12 #include <stack> 12 #include <stack>
13 #include <string> 13 #include <string>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/at_exit.h" 16 #include "base/at_exit.h"
17 #include "base/atomicops.h" 17 #include "base/atomicops.h"
18 #include "base/bind.h" 18 #include "base/bind.h"
19 #include "base/command_line.h" 19 #include "base/command_line.h"
20 #include "base/debug/trace_event.h" 20 #include "base/debug/trace_event.h"
21 #if defined(OS_MACOSX)
22 #include "base/mac/scoped_cftyperef.h"
23 #endif
24 #include "base/memory/scoped_ptr.h" 21 #include "base/memory/scoped_ptr.h"
25 #include "base/string_number_conversions.h" 22 #include "base/string_number_conversions.h"
26 #include "base/stringprintf.h" 23 #include "base/stringprintf.h"
27 #include "build/build_config.h" 24 #include "build/build_config.h"
28 #define GLES2_GPU_SERVICE 1 25 #define GLES2_GPU_SERVICE 1
29 #include "gpu/command_buffer/common/gles2_cmd_format.h" 26 #include "gpu/command_buffer/common/gles2_cmd_format.h"
30 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 27 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
31 #include "gpu/command_buffer/common/debug_marker_manager.h" 28 #include "gpu/command_buffer/common/debug_marker_manager.h"
32 #include "gpu/command_buffer/common/id_allocator.h" 29 #include "gpu/command_buffer/common/id_allocator.h"
33 #include "gpu/command_buffer/service/buffer_manager.h" 30 #include "gpu/command_buffer/service/buffer_manager.h"
(...skipping 20 matching lines...) Expand all
54 #include "gpu/command_buffer/service/stream_texture_manager.h" 51 #include "gpu/command_buffer/service/stream_texture_manager.h"
55 #include "gpu/command_buffer/service/texture_definition.h" 52 #include "gpu/command_buffer/service/texture_definition.h"
56 #include "gpu/command_buffer/service/texture_manager.h" 53 #include "gpu/command_buffer/service/texture_manager.h"
57 #include "gpu/command_buffer/service/vertex_attrib_manager.h" 54 #include "gpu/command_buffer/service/vertex_attrib_manager.h"
58 #include "gpu/command_buffer/service/vertex_array_manager.h" 55 #include "gpu/command_buffer/service/vertex_array_manager.h"
59 #include "ui/gl/async_pixel_transfer_delegate.h" 56 #include "ui/gl/async_pixel_transfer_delegate.h"
60 #include "ui/gl/gl_bindings.h" 57 #include "ui/gl/gl_bindings.h"
61 #include "ui/gl/gl_image.h" 58 #include "ui/gl/gl_image.h"
62 #include "ui/gl/gl_implementation.h" 59 #include "ui/gl/gl_implementation.h"
63 #include "ui/gl/gl_surface.h" 60 #include "ui/gl/gl_surface.h"
61
64 #if defined(OS_MACOSX) 62 #if defined(OS_MACOSX)
63 #include "base/mac/scoped_cftyperef.h"
64 #include "ui/gl/gl_context_cgl.h"
65 #include "ui/surface/io_surface_support_mac.h" 65 #include "ui/surface/io_surface_support_mac.h"
66 #endif 66 #endif
67 67
68 // TODO(zmo): we can't include "City.h" due to type def conflicts. 68 // TODO(zmo): we can't include "City.h" due to type def conflicts.
69 extern uint64 CityHash64(const char*, size_t); 69 extern uint64 CityHash64(const char*, size_t);
70 70
71 namespace gpu { 71 namespace gpu {
72 namespace gles2 { 72 namespace gles2 {
73 73
74 namespace { 74 namespace {
(...skipping 2491 matching lines...) Expand 10 before | Expand all | Expand 10 after
2566 2566
2567 DoBindBuffer(GL_ARRAY_BUFFER, 0); 2567 DoBindBuffer(GL_ARRAY_BUFFER, 0);
2568 DoBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); 2568 DoBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
2569 DoBindFramebuffer(GL_FRAMEBUFFER, 0); 2569 DoBindFramebuffer(GL_FRAMEBUFFER, 0);
2570 DoBindRenderbuffer(GL_RENDERBUFFER, 0); 2570 DoBindRenderbuffer(GL_RENDERBUFFER, 0);
2571 2571
2572 if (feature_info_->workarounds().reverse_point_sprite_coord_origin) { 2572 if (feature_info_->workarounds().reverse_point_sprite_coord_origin) {
2573 glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT); 2573 glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);
2574 } 2574 }
2575 2575
2576 #if defined(OS_MACOSX)
2577 if (feature_info_->workarounds().force_cgl_set_virtual_screen)
2578 gfx::GLContextCGL::ForceCGLSetVirtualScreen();
2579 #endif
2580
2576 // Create a delegate to perform async pixel transfers. 2581 // Create a delegate to perform async pixel transfers.
2577 async_pixel_transfer_delegate_ = 2582 async_pixel_transfer_delegate_ =
2578 gfx::AsyncPixelTransferDelegate::Create(context.get()); 2583 gfx::AsyncPixelTransferDelegate::Create(context.get());
2579 2584
2580 return true; 2585 return true;
2581 } 2586 }
2582 2587
2583 void GLES2DecoderImpl::UpdateCapabilities() { 2588 void GLES2DecoderImpl::UpdateCapabilities() {
2584 util_.set_num_compressed_texture_formats( 2589 util_.set_num_compressed_texture_formats(
2585 validators_->compressed_texture_format.GetValues().size()); 2590 validators_->compressed_texture_format.GetValues().size());
(...skipping 7939 matching lines...) Expand 10 before | Expand all | Expand 10 after
10525 return error::kNoError; 10530 return error::kNoError;
10526 } 10531 }
10527 10532
10528 // Include the auto-generated part of this file. We split this because it means 10533 // Include the auto-generated part of this file. We split this because it means
10529 // we can easily edit the non-auto generated parts right here in this file 10534 // we can easily edit the non-auto generated parts right here in this file
10530 // instead of having to edit some template or the code generator. 10535 // instead of having to edit some template or the code generator.
10531 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 10536 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10532 10537
10533 } // namespace gles2 10538 } // namespace gles2
10534 } // namespace gpu 10539 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698