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

Side by Side Diff: content/common/gpu/image_transport_surface.cc

Issue 13926009: Avoid sending empty OnRepaint msgs and propagate window damage correctly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 "content/common/gpu/image_transport_surface.h" 5 #include "content/common/gpu/image_transport_surface.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 if (did_unschedule_) { 315 if (did_unschedule_) {
316 did_unschedule_ = false; 316 did_unschedule_ = false;
317 helper_->SetScheduled(true); 317 helper_->SetScheduled(true);
318 } 318 }
319 } 319 }
320 320
321 void PassThroughImageTransportSurface::OnResizeViewACK() { 321 void PassThroughImageTransportSurface::OnResizeViewACK() {
322 DCHECK(transport_); 322 DCHECK(transport_);
323 Resize(new_size_); 323 Resize(new_size_);
324 324
325 TRACE_EVENT_ASYNC_END0("gpu", "OnResize", this);
325 helper_->SetScheduled(true); 326 helper_->SetScheduled(true);
326 } 327 }
327 328
328 void PassThroughImageTransportSurface::OnResize(gfx::Size size) { 329 void PassThroughImageTransportSurface::OnResize(gfx::Size size) {
329 new_size_ = size; 330 new_size_ = size;
330 331
331 if (transport_) { 332 if (transport_) {
332 helper_->SendResizeView(size); 333 helper_->SendResizeView(size);
333 helper_->SetScheduled(false); 334 helper_->SetScheduled(false);
335 TRACE_EVENT_ASYNC_BEGIN2("gpu", "OnResize", this,
336 "width", size.width(), "height", size.height());
334 } else { 337 } else {
335 Resize(new_size_); 338 Resize(new_size_);
336 } 339 }
337 } 340 }
338 341
339 gfx::Size PassThroughImageTransportSurface::GetSize() { 342 gfx::Size PassThroughImageTransportSurface::GetSize() {
340 return GLSurfaceAdapter::GetSize(); 343 return GLSurfaceAdapter::GetSize();
341 } 344 }
342 345
343 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {} 346 PassThroughImageTransportSurface::~PassThroughImageTransportSurface() {}
344 347
345 void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() { 348 void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() {
346 gfx::VSyncProvider* vsync_provider = GetVSyncProvider(); 349 gfx::VSyncProvider* vsync_provider = GetVSyncProvider();
347 if (vsync_provider) { 350 if (vsync_provider) {
348 vsync_provider->GetVSyncParameters( 351 vsync_provider->GetVSyncParameters(
349 base::Bind(&ImageTransportHelper::SendUpdateVSyncParameters, 352 base::Bind(&ImageTransportHelper::SendUpdateVSyncParameters,
350 helper_->AsWeakPtr())); 353 helper_->AsWeakPtr()));
351 } 354 }
352 } 355 }
353 356
354 } // namespace content 357 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698