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

Side by Side Diff: ui/gl/gl_surface_wgl.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
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 "ui/gl/gl_surface_wgl.h" 5 #include "ui/gl/gl_surface_wgl.h"
6 6
7 #include "base/debug/trace_event.h"
7 #include "base/logging.h" 8 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
9 #include "ui/gl/gl_bindings.h" 10 #include "ui/gl/gl_bindings.h"
10 #include "ui/gl/gl_gl_api_implementation.h" 11 #include "ui/gl/gl_gl_api_implementation.h"
11 #include "ui/gl/gl_wgl_api_implementation.h" 12 #include "ui/gl/gl_wgl_api_implementation.h"
12 13
13 namespace gfx { 14 namespace gfx {
14 15
15 namespace { 16 namespace {
16 const PIXELFORMATDESCRIPTOR kPixelFormatDescriptor = { 17 const PIXELFORMATDESCRIPTOR kPixelFormatDescriptor = {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 261
261 child_window_ = NULL; 262 child_window_ = NULL;
262 device_context_ = NULL; 263 device_context_ = NULL;
263 } 264 }
264 265
265 bool NativeViewGLSurfaceWGL::IsOffscreen() { 266 bool NativeViewGLSurfaceWGL::IsOffscreen() {
266 return false; 267 return false;
267 } 268 }
268 269
269 bool NativeViewGLSurfaceWGL::SwapBuffers() { 270 bool NativeViewGLSurfaceWGL::SwapBuffers() {
271 TRACE_EVENT2("gpu", "NativeViewGLSurfaceWGL:RealSwapBuffers",
272 "width", GetSize().width(),
273 "height", GetSize().height());
274
270 // Resize the child window to match the parent before swapping. Do not repaint 275 // Resize the child window to match the parent before swapping. Do not repaint
271 // it as it moves. 276 // it as it moves.
272 RECT rect; 277 RECT rect;
273 if (!GetClientRect(window_, &rect)) 278 if (!GetClientRect(window_, &rect))
274 return false; 279 return false;
275 if (!MoveWindow(child_window_, 280 if (!MoveWindow(child_window_,
276 0, 0, 281 0, 0,
277 rect.right - rect.left, 282 rect.right - rect.left,
278 rect.bottom - rect.top, 283 rect.bottom - rect.top,
279 FALSE)) { 284 FALSE)) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 364
360 gfx::Size PbufferGLSurfaceWGL::GetSize() { 365 gfx::Size PbufferGLSurfaceWGL::GetSize() {
361 return size_; 366 return size_;
362 } 367 }
363 368
364 void* PbufferGLSurfaceWGL::GetHandle() { 369 void* PbufferGLSurfaceWGL::GetHandle() {
365 return device_context_; 370 return device_context_;
366 } 371 }
367 372
368 } // namespace gfx 373 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698