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

Side by Side Diff: ui/gl/gl_surface_egl.cc

Issue 137823002: GPU: Add trace for real SwapBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | ui/gl/gl_surface_glx.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This include must be here so that the includes provided transitively 5 // This include must be here so that the includes provided transitively
6 // by gl_surface_egl.h don't make it impossible to compile this code. 6 // by gl_surface_egl.h don't make it impossible to compile this code.
7 #include "third_party/mesa/src/include/GL/osmesa.h" 7 #include "third_party/mesa/src/include/GL/osmesa.h"
8 8
9 #include "ui/gl/gl_surface_egl.h" 9 #include "ui/gl/gl_surface_egl.h"
10 10
11 #if defined(OS_ANDROID) 11 #if defined(OS_ANDROID)
12 #include <android/native_window_jni.h> 12 #include <android/native_window_jni.h>
13 #endif 13 #endif
14 14
15 #include "base/debug/trace_event.h"
no sievers 2014/01/14 22:22:18 nit: order
epennerAtGoogle 2014/01/14 22:40:53 Oy. I figured presubmit was referring to the osmes
15 #include "base/command_line.h" 16 #include "base/command_line.h"
16 #include "base/logging.h" 17 #include "base/logging.h"
17 #include "base/memory/scoped_ptr.h" 18 #include "base/memory/scoped_ptr.h"
18 #include "base/message_loop/message_loop.h" 19 #include "base/message_loop/message_loop.h"
19 #include "build/build_config.h" 20 #include "build/build_config.h"
20 #include "ui/gl/egl_util.h" 21 #include "ui/gl/egl_util.h"
21 #include "ui/gl/gl_context.h" 22 #include "ui/gl/gl_context.h"
22 #include "ui/gl/gl_implementation.h" 23 #include "ui/gl/gl_implementation.h"
23 #include "ui/gl/gl_surface_osmesa.h" 24 #include "ui/gl/gl_surface_osmesa.h"
24 #include "ui/gl/gl_surface_stub.h" 25 #include "ui/gl/gl_surface_stub.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 } 388 }
388 return config_; 389 return config_;
389 #endif 390 #endif
390 } 391 }
391 392
392 bool NativeViewGLSurfaceEGL::IsOffscreen() { 393 bool NativeViewGLSurfaceEGL::IsOffscreen() {
393 return false; 394 return false;
394 } 395 }
395 396
396 bool NativeViewGLSurfaceEGL::SwapBuffers() { 397 bool NativeViewGLSurfaceEGL::SwapBuffers() {
398 TRACE_EVENT2("gpu", "NativeViewGLSurfaceEGL:RealSwapBuffers",
399 "width", GetSize().width(),
400 "height", GetSize().height());
401
397 if (!eglSwapBuffers(GetDisplay(), surface_)) { 402 if (!eglSwapBuffers(GetDisplay(), surface_)) {
398 DVLOG(1) << "eglSwapBuffers failed with error " 403 DVLOG(1) << "eglSwapBuffers failed with error "
399 << GetLastEGLErrorString(); 404 << GetLastEGLErrorString();
400 return false; 405 return false;
401 } 406 }
402 407
403 return true; 408 return true;
404 } 409 }
405 410
406 gfx::Size NativeViewGLSurfaceEGL::GetSize() { 411 gfx::Size NativeViewGLSurfaceEGL::GetSize() {
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 } 766 }
762 default: 767 default:
763 NOTREACHED(); 768 NOTREACHED();
764 return NULL; 769 return NULL;
765 } 770 }
766 } 771 }
767 772
768 #endif 773 #endif
769 774
770 } // namespace gfx 775 } // namespace gfx
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | ui/gl/gl_surface_glx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698