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

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

Issue 12252058: Add a |scope| argument to TRACE_EVENT_INSTANT* and require its presence. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use flags to record scope Created 7 years, 10 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 4519 matching lines...) Expand 10 before | Expand all | Expand 10 after
4530 } 4530 }
4531 DoRegisterSharedIdsCHROMIUM(namespace_id, n, ids); 4531 DoRegisterSharedIdsCHROMIUM(namespace_id, n, ids);
4532 return error::kNoError; 4532 return error::kNoError;
4533 } 4533 }
4534 4534
4535 error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) { 4535 error::Error GLES2DecoderImpl::DoClear(GLbitfield mask) {
4536 DCHECK(!ShouldDeferDraws()); 4536 DCHECK(!ShouldDeferDraws());
4537 if (CheckBoundFramebuffersValid("glClear")) { 4537 if (CheckBoundFramebuffersValid("glClear")) {
4538 UNSHIPPED_TRACE_EVENT_INSTANT2( 4538 UNSHIPPED_TRACE_EVENT_INSTANT2(
4539 "test_gpu", "DoClear", 4539 "test_gpu", "DoClear",
4540 TRACE_EVENT_SCOPE_THREAD,
4540 "red", state_.color_clear_red, 4541 "red", state_.color_clear_red,
4541 "green", state_.color_clear_green); 4542 "green", state_.color_clear_green);
4542 ApplyDirtyState(); 4543 ApplyDirtyState();
4543 glClear(mask); 4544 glClear(mask);
4544 } 4545 }
4545 return error::kNoError; 4546 return error::kNoError;
4546 } 4547 }
4547 4548
4548 void GLES2DecoderImpl::DoFramebufferRenderbuffer( 4549 void GLES2DecoderImpl::DoFramebufferRenderbuffer(
4549 GLenum target, GLenum attachment, GLenum renderbuffertarget, 4550 GLenum target, GLenum attachment, GLenum renderbuffertarget,
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
4800 } 4801 }
4801 glDisable(GL_SCISSOR_TEST); 4802 glDisable(GL_SCISSOR_TEST);
4802 if (IsAngle()) { 4803 if (IsAngle()) {
4803 glBlitFramebufferANGLE( 4804 glBlitFramebufferANGLE(
4804 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); 4805 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
4805 } else { 4806 } else {
4806 glBlitFramebufferEXT( 4807 glBlitFramebufferEXT(
4807 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); 4808 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
4808 } 4809 }
4809 EnableDisable(GL_SCISSOR_TEST, state_.enable_flags.scissor_test); 4810 EnableDisable(GL_SCISSOR_TEST, state_.enable_flags.scissor_test);
4810 UNSHIPPED_TRACE_EVENT_INSTANT1("test_gpu", "DoBlit", "width", srcX1 - srcX0); 4811 UNSHIPPED_TRACE_EVENT_INSTANT1("test_gpu", "DoBlit", TRACE_EVENT_SCOPE_THREAD,
4812 "width", srcX1 - srcX0);
4811 } 4813 }
4812 4814
4813 void GLES2DecoderImpl::DoRenderbufferStorageMultisample( 4815 void GLES2DecoderImpl::DoRenderbufferStorageMultisample(
4814 GLenum target, GLsizei samples, GLenum internalformat, 4816 GLenum target, GLsizei samples, GLenum internalformat,
4815 GLsizei width, GLsizei height) { 4817 GLsizei width, GLsizei height) {
4816 if (!features().chromium_framebuffer_multisample) { 4818 if (!features().chromium_framebuffer_multisample) {
4817 SetGLError(GL_INVALID_OPERATION, 4819 SetGLError(GL_INVALID_OPERATION,
4818 "glRenderbufferStorageMultisampleEXT", "function not available"); 4820 "glRenderbufferStorageMultisampleEXT", "function not available");
4819 return; 4821 return;
4820 } 4822 }
(...skipping 3822 matching lines...) Expand 10 before | Expand all | Expand 10 after
8643 #endif 8645 #endif
8644 } 8646 }
8645 8647
8646 error::Error GLES2DecoderImpl::HandleSwapBuffers( 8648 error::Error GLES2DecoderImpl::HandleSwapBuffers(
8647 uint32 immediate_data_size, const gles2::SwapBuffers& c) { 8649 uint32 immediate_data_size, const gles2::SwapBuffers& c) {
8648 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); 8650 bool is_offscreen = !!offscreen_target_frame_buffer_.get();
8649 8651
8650 int this_frame_number = frame_number_++; 8652 int this_frame_number = frame_number_++;
8651 // TRACE_EVENT for gpu tests: 8653 // TRACE_EVENT for gpu tests:
8652 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency", 8654 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffersLatency",
8655 TRACE_EVENT_SCOPE_THREAD,
8653 "GLImpl", static_cast<int>(gfx::GetGLImplementation()), 8656 "GLImpl", static_cast<int>(gfx::GetGLImplementation()),
8654 "width", (is_offscreen ? offscreen_size_.width() : 8657 "width", (is_offscreen ? offscreen_size_.width() :
8655 surface_->GetSize().width())); 8658 surface_->GetSize().width()));
8656 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", 8659 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers",
8657 "offscreen", is_offscreen, 8660 "offscreen", is_offscreen,
8658 "frame", this_frame_number); 8661 "frame", this_frame_number);
8659 // If offscreen then don't actually SwapBuffers to the display. Just copy 8662 // If offscreen then don't actually SwapBuffers to the display. Just copy
8660 // the rendered frame to another frame buffer. 8663 // the rendered frame to another frame buffer.
8661 if (is_offscreen) { 8664 if (is_offscreen) {
8662 TRACE_EVENT2("gpu", "Offscreen", 8665 TRACE_EVENT2("gpu", "Offscreen",
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
10095 return error::kNoError; 10098 return error::kNoError;
10096 } 10099 }
10097 10100
10098 // Include the auto-generated part of this file. We split this because it means 10101 // Include the auto-generated part of this file. We split this because it means
10099 // we can easily edit the non-auto generated parts right here in this file 10102 // we can easily edit the non-auto generated parts right here in this file
10100 // instead of having to edit some template or the code generator. 10103 // instead of having to edit some template or the code generator.
10101 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 10104 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10102 10105
10103 } // namespace gles2 10106 } // namespace gles2
10104 } // namespace gpu 10107 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698