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

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

Issue 8883005: Input latency performance test that uses tracing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 3811 matching lines...) Expand 10 before | Expand all | Expand 10 after
3822 } 3822 }
3823 if (ids == NULL) { 3823 if (ids == NULL) {
3824 return error::kOutOfBounds; 3824 return error::kOutOfBounds;
3825 } 3825 }
3826 DoRegisterSharedIdsCHROMIUM(namespace_id, n, ids); 3826 DoRegisterSharedIdsCHROMIUM(namespace_id, n, ids);
3827 return error::kNoError; 3827 return error::kNoError;
3828 } 3828 }
3829 3829
3830 void GLES2DecoderImpl::DoClear(GLbitfield mask) { 3830 void GLES2DecoderImpl::DoClear(GLbitfield mask) {
3831 if (CheckBoundFramebuffersValid("glClear")) { 3831 if (CheckBoundFramebuffersValid("glClear")) {
3832 UNSHIPPED_TRACE_EVENT_INSTANT2("test_gpu", "DoClear", "red", clear_red_,
3833 "green", clear_green_);
3832 ApplyDirtyState(); 3834 ApplyDirtyState();
3833 glClear(mask); 3835 glClear(mask);
3834 } 3836 }
3835 } 3837 }
3836 3838
3837 void GLES2DecoderImpl::DoFramebufferRenderbuffer( 3839 void GLES2DecoderImpl::DoFramebufferRenderbuffer(
3838 GLenum target, GLenum attachment, GLenum renderbuffertarget, 3840 GLenum target, GLenum attachment, GLenum renderbuffertarget,
3839 GLuint client_renderbuffer_id) { 3841 GLuint client_renderbuffer_id) {
3840 FramebufferManager::FramebufferInfo* framebuffer_info = 3842 FramebufferManager::FramebufferInfo* framebuffer_info =
3841 GetFramebufferInfoForTarget(target); 3843 GetFramebufferInfoForTarget(target);
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
4130 SetGLError(GL_INVALID_OPERATION, 4132 SetGLError(GL_INVALID_OPERATION,
4131 "glBlitFramebufferEXT: function not available"); 4133 "glBlitFramebufferEXT: function not available");
4132 } 4134 }
4133 if (IsAngle()) { 4135 if (IsAngle()) {
4134 glBlitFramebufferANGLE( 4136 glBlitFramebufferANGLE(
4135 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); 4137 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
4136 } else { 4138 } else {
4137 glBlitFramebufferEXT( 4139 glBlitFramebufferEXT(
4138 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); 4140 srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
4139 } 4141 }
4142 UNSHIPPED_TRACE_EVENT_INSTANT1("test_gpu", "DoBlit", "width", srcX1 - srcX0);
4140 } 4143 }
4141 4144
4142 void GLES2DecoderImpl::DoRenderbufferStorageMultisample( 4145 void GLES2DecoderImpl::DoRenderbufferStorageMultisample(
4143 GLenum target, GLsizei samples, GLenum internalformat, 4146 GLenum target, GLsizei samples, GLenum internalformat,
4144 GLsizei width, GLsizei height) { 4147 GLsizei width, GLsizei height) {
4145 if (!feature_info_->feature_flags().chromium_framebuffer_multisample) { 4148 if (!feature_info_->feature_flags().chromium_framebuffer_multisample) {
4146 SetGLError(GL_INVALID_OPERATION, 4149 SetGLError(GL_INVALID_OPERATION,
4147 "glRenderbufferStorageMultisampleEXT: function not available"); 4150 "glRenderbufferStorageMultisampleEXT: function not available");
4148 return; 4151 return;
4149 } 4152 }
(...skipping 3071 matching lines...) Expand 10 before | Expand all | Expand 10 after
7221 // TODO(gman): call glShaderBinary 7224 // TODO(gman): call glShaderBinary
7222 return error::kNoError; 7225 return error::kNoError;
7223 #endif 7226 #endif
7224 } 7227 }
7225 7228
7226 error::Error GLES2DecoderImpl::HandleSwapBuffers( 7229 error::Error GLES2DecoderImpl::HandleSwapBuffers(
7227 uint32 immediate_data_size, const gles2::SwapBuffers& c) { 7230 uint32 immediate_data_size, const gles2::SwapBuffers& c) {
7228 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); 7231 bool is_offscreen = !!offscreen_target_frame_buffer_.get();
7229 int this_frame_number = frame_number_++; 7232 int this_frame_number = frame_number_++;
7230 // TRACE_EVENT for gpu tests: 7233 // TRACE_EVENT for gpu tests:
7231 TRACE_EVENT_INSTANT1("test_gpu", "SwapBuffers", 7234 TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers",
7232 "GLImpl", static_cast<int>(gfx::GetGLImplementation())); 7235 "GLImpl", static_cast<int>(gfx::GetGLImplementation()),
7236 "width", (is_offscreen ? offscreen_size_.width() :
7237 surface_->GetSize().width()));
7233 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers", 7238 TRACE_EVENT2("gpu", "GLES2DecoderImpl::HandleSwapBuffers",
7234 "offscreen", is_offscreen, 7239 "offscreen", is_offscreen,
7235 "frame", this_frame_number); 7240 "frame", this_frame_number);
7236 // If offscreen then don't actually SwapBuffers to the display. Just copy 7241 // If offscreen then don't actually SwapBuffers to the display. Just copy
7237 // the rendered frame to another frame buffer. 7242 // the rendered frame to another frame buffer.
7238 if (is_offscreen) { 7243 if (is_offscreen) {
7239 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { 7244 if (offscreen_size_ != offscreen_saved_color_texture_->size()) {
7240 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, 7245 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557,
7241 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will 7246 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will
7242 // fix this. 7247 // fix this.
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
7869 7874
7870 } 7875 }
7871 7876
7872 // Include the auto-generated part of this file. We split this because it means 7877 // Include the auto-generated part of this file. We split this because it means
7873 // we can easily edit the non-auto generated parts right here in this file 7878 // we can easily edit the non-auto generated parts right here in this file
7874 // instead of having to edit some template or the code generator. 7879 // instead of having to edit some template or the code generator.
7875 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 7880 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
7876 7881
7877 } // namespace gles2 7882 } // namespace gles2
7878 } // namespace gpu 7883 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698