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

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

Issue 23926013: gpu: Record GL state to trace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo. Created 7 years, 3 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>
(...skipping 24 matching lines...) Expand all
35 #include "gpu/command_buffer/service/buffer_manager.h" 35 #include "gpu/command_buffer/service/buffer_manager.h"
36 #include "gpu/command_buffer/service/cmd_buffer_engine.h" 36 #include "gpu/command_buffer/service/cmd_buffer_engine.h"
37 #include "gpu/command_buffer/service/context_group.h" 37 #include "gpu/command_buffer/service/context_group.h"
38 #include "gpu/command_buffer/service/context_state.h" 38 #include "gpu/command_buffer/service/context_state.h"
39 #include "gpu/command_buffer/service/error_state.h" 39 #include "gpu/command_buffer/service/error_state.h"
40 #include "gpu/command_buffer/service/feature_info.h" 40 #include "gpu/command_buffer/service/feature_info.h"
41 #include "gpu/command_buffer/service/framebuffer_manager.h" 41 #include "gpu/command_buffer/service/framebuffer_manager.h"
42 #include "gpu/command_buffer/service/gl_utils.h" 42 #include "gpu/command_buffer/service/gl_utils.h"
43 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" 43 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h"
44 #include "gpu/command_buffer/service/gles2_cmd_validation.h" 44 #include "gpu/command_buffer/service/gles2_cmd_validation.h"
45 #include "gpu/command_buffer/service/gpu_state_tracer.h"
45 #include "gpu/command_buffer/service/gpu_switches.h" 46 #include "gpu/command_buffer/service/gpu_switches.h"
46 #include "gpu/command_buffer/service/gpu_tracer.h" 47 #include "gpu/command_buffer/service/gpu_tracer.h"
47 #include "gpu/command_buffer/service/image_manager.h" 48 #include "gpu/command_buffer/service/image_manager.h"
48 #include "gpu/command_buffer/service/mailbox_manager.h" 49 #include "gpu/command_buffer/service/mailbox_manager.h"
49 #include "gpu/command_buffer/service/memory_tracking.h" 50 #include "gpu/command_buffer/service/memory_tracking.h"
50 #include "gpu/command_buffer/service/program_manager.h" 51 #include "gpu/command_buffer/service/program_manager.h"
51 #include "gpu/command_buffer/service/query_manager.h" 52 #include "gpu/command_buffer/service/query_manager.h"
52 #include "gpu/command_buffer/service/renderbuffer_manager.h" 53 #include "gpu/command_buffer/service/renderbuffer_manager.h"
53 #include "gpu/command_buffer/service/shader_manager.h" 54 #include "gpu/command_buffer/service/shader_manager.h"
54 #include "gpu/command_buffer/service/shader_translator.h" 55 #include "gpu/command_buffer/service/shader_translator.h"
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 GLsizei viewport_max_height_; 1659 GLsizei viewport_max_height_;
1659 1660
1660 // Command buffer stats. 1661 // Command buffer stats.
1661 base::TimeDelta total_processing_commands_time_; 1662 base::TimeDelta total_processing_commands_time_;
1662 1663
1663 // States related to each manager. 1664 // States related to each manager.
1664 DecoderTextureState texture_state_; 1665 DecoderTextureState texture_state_;
1665 DecoderFramebufferState framebuffer_state_; 1666 DecoderFramebufferState framebuffer_state_;
1666 1667
1667 scoped_ptr<GPUTracer> gpu_tracer_; 1668 scoped_ptr<GPUTracer> gpu_tracer_;
1669 scoped_ptr<GPUStateTracer> gpu_state_tracer_;
1668 1670
1669 std::queue<linked_ptr<FenceCallback> > pending_readpixel_fences_; 1671 std::queue<linked_ptr<FenceCallback> > pending_readpixel_fences_;
1670 1672
1671 DISALLOW_COPY_AND_ASSIGN(GLES2DecoderImpl); 1673 DISALLOW_COPY_AND_ASSIGN(GLES2DecoderImpl);
1672 }; 1674 };
1673 1675
1674 ScopedGLErrorSuppressor::ScopedGLErrorSuppressor( 1676 ScopedGLErrorSuppressor::ScopedGLErrorSuppressor(
1675 const char* function_name, GLES2DecoderImpl* decoder) 1677 const char* function_name, GLES2DecoderImpl* decoder)
1676 : function_name_(function_name), 1678 : function_name_(function_name),
1677 decoder_(decoder) { 1679 decoder_(decoder) {
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 const gfx::Size& size, 2124 const gfx::Size& size,
2123 const DisallowedFeatures& disallowed_features, 2125 const DisallowedFeatures& disallowed_features,
2124 const char* allowed_extensions, 2126 const char* allowed_extensions,
2125 const std::vector<int32>& attribs) { 2127 const std::vector<int32>& attribs) {
2126 TRACE_EVENT0("gpu", "GLES2DecoderImpl::Initialize"); 2128 TRACE_EVENT0("gpu", "GLES2DecoderImpl::Initialize");
2127 DCHECK(context->IsCurrent(surface.get())); 2129 DCHECK(context->IsCurrent(surface.get()));
2128 DCHECK(!context_.get()); 2130 DCHECK(!context_.get());
2129 2131
2130 set_initialized(); 2132 set_initialized();
2131 gpu_tracer_ = GPUTracer::Create(); 2133 gpu_tracer_ = GPUTracer::Create();
2134 gpu_state_tracer_ = GPUStateTracer::Create(&state_);
2132 2135
2133 if (CommandLine::ForCurrentProcess()->HasSwitch( 2136 if (CommandLine::ForCurrentProcess()->HasSwitch(
2134 switches::kEnableGPUDebugging)) { 2137 switches::kEnableGPUDebugging)) {
2135 set_debug(true); 2138 set_debug(true);
2136 } 2139 }
2137 2140
2138 if (CommandLine::ForCurrentProcess()->HasSwitch( 2141 if (CommandLine::ForCurrentProcess()->HasSwitch(
2139 switches::kEnableGPUCommandLogging)) { 2142 switches::kEnableGPUCommandLogging)) {
2140 set_log_commands(true); 2143 set_log_commands(true);
2141 } 2144 }
(...skipping 6426 matching lines...) Expand 10 before | Expand all | Expand 10 after
8568 int this_frame_number = frame_number_++; 8571 int this_frame_number = frame_number_++;
8569 // TRACE_EVENT for gpu tests: 8572 // TRACE_EVENT for gpu tests:
8570 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency", 8573 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency",
8571 TRACE_EVENT_SCOPE_THREAD, 8574 TRACE_EVENT_SCOPE_THREAD,
8572 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), 8575 "GLImpl", static_cast<int>(gfx::GetGLImplementation()),
8573 "width", (is_offscreen ? offscreen_size_.width() : 8576 "width", (is_offscreen ? offscreen_size_.width() :
8574 surface_->GetSize().width())); 8577 surface_->GetSize().width()));
8575 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoSwapBuffers", 8578 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoSwapBuffers",
8576 "offscreen", is_offscreen, 8579 "offscreen", is_offscreen,
8577 "frame", this_frame_number); 8580 "frame", this_frame_number);
8581 bool is_tracing;
8582 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"),
8583 &is_tracing);
8584 if (is_tracing)
8585 gpu_state_tracer_->TakeSnapshot();
piman 2013/09/09 21:25:54 A non-default framebuffer could be bound when Swap
piman 2013/09/09 21:25:54 Could we also do this in HandlePostSubBufferCHROMI
8586
8578 // If offscreen then don't actually SwapBuffers to the display. Just copy 8587 // If offscreen then don't actually SwapBuffers to the display. Just copy
8579 // the rendered frame to another frame buffer. 8588 // the rendered frame to another frame buffer.
8580 if (is_offscreen) { 8589 if (is_offscreen) {
8581 TRACE_EVENT2("gpu", "Offscreen", 8590 TRACE_EVENT2("gpu", "Offscreen",
8582 "width", offscreen_size_.width(), "height", offscreen_size_.height()); 8591 "width", offscreen_size_.width(), "height", offscreen_size_.height());
8583 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { 8592 if (offscreen_size_ != offscreen_saved_color_texture_->size()) {
8584 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, 8593 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557,
8585 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will 8594 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will
8586 // fix this. 8595 // fix this.
8587 if (workarounds().needs_offscreen_buffer_workaround) { 8596 if (workarounds().needs_offscreen_buffer_workaround) {
(...skipping 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after
10264 return error::kNoError; 10273 return error::kNoError;
10265 } 10274 }
10266 10275
10267 // Include the auto-generated part of this file. We split this because it means 10276 // Include the auto-generated part of this file. We split this because it means
10268 // we can easily edit the non-auto generated parts right here in this file 10277 // we can easily edit the non-auto generated parts right here in this file
10269 // instead of having to edit some template or the code generator. 10278 // instead of having to edit some template or the code generator.
10270 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 10279 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10271 10280
10272 } // namespace gles2 10281 } // namespace gles2
10273 } // namespace gpu 10282 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698