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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index be644ce11ef3c4088bf6f42fa6eb03582a9d01c1..7007c744a21abc7b2b8f7016def4b5df6c181273 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -42,6 +42,7 @@
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h"
#include "gpu/command_buffer/service/gles2_cmd_validation.h"
+#include "gpu/command_buffer/service/gpu_state_tracer.h"
#include "gpu/command_buffer/service/gpu_switches.h"
#include "gpu/command_buffer/service/gpu_tracer.h"
#include "gpu/command_buffer/service/image_manager.h"
@@ -1665,6 +1666,7 @@ class GLES2DecoderImpl : public GLES2Decoder {
DecoderFramebufferState framebuffer_state_;
scoped_ptr<GPUTracer> gpu_tracer_;
+ scoped_ptr<GPUStateTracer> gpu_state_tracer_;
std::queue<linked_ptr<FenceCallback> > pending_readpixel_fences_;
@@ -2129,6 +2131,7 @@ bool GLES2DecoderImpl::Initialize(
set_initialized();
gpu_tracer_ = GPUTracer::Create();
+ gpu_state_tracer_ = GPUStateTracer::Create(&state_);
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableGPUDebugging)) {
@@ -8575,6 +8578,12 @@ void GLES2DecoderImpl::DoSwapBuffers() {
TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoSwapBuffers",
"offscreen", is_offscreen,
"frame", this_frame_number);
+ bool is_tracing;
+ TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"),
+ &is_tracing);
+ if (is_tracing)
+ 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
+
// If offscreen then don't actually SwapBuffers to the display. Just copy
// the rendered frame to another frame buffer.
if (is_offscreen) {

Powered by Google App Engine
This is Rietveld 408576698