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

Side by Side Diff: ui/gfx/surface/accelerated_surface_win.cc

Issue 8699008: Use callback_forward.h instead of callback.h where possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove callback_forward.h, which was committed as part of a separate CL. 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
« no previous file with comments | « ui/gfx/surface/accelerated_surface_win.h ('k') | no next file » | 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) 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 "ui/gfx/surface/accelerated_surface_win.h" 5 #include "ui/gfx/surface/accelerated_surface_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <list> 9 #include <list>
10 10
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 void AcceleratedSurface::Destroy() { 255 void AcceleratedSurface::Destroy() {
256 g_present_thread_pool.Pointer()->AcknowledgeEarly( 256 g_present_thread_pool.Pointer()->AcknowledgeEarly(
257 FROM_HERE, 257 FROM_HERE,
258 device_, 258 device_,
259 base::Bind(&AcceleratedSurface::QueriesDestroyed, this)); 259 base::Bind(&AcceleratedSurface::QueriesDestroyed, this));
260 } 260 }
261 261
262 void AcceleratedSurface::AsyncPresentAndAcknowledge( 262 void AcceleratedSurface::AsyncPresentAndAcknowledge(
263 const gfx::Size& size, 263 const gfx::Size& size,
264 int64 surface_id, 264 int64 surface_id,
265 base::Closure completion_task) { 265 const base::Closure& completion_task) {
266 const int kRound = 64; 266 const int kRound = 64;
267 gfx::Size quantized_size( 267 gfx::Size quantized_size(
268 std::max(1, (size.width() + kRound - 1) / kRound * kRound), 268 std::max(1, (size.width() + kRound - 1) / kRound * kRound),
269 std::max(1, (size.height() + kRound - 1) / kRound * kRound)); 269 std::max(1, (size.height() + kRound - 1) / kRound * kRound));
270 270
271 if (pending_size_ != quantized_size) { 271 if (pending_size_ != quantized_size) {
272 pending_size_ = quantized_size; 272 pending_size_ = quantized_size;
273 base::AtomicRefCountInc(&num_pending_resizes_); 273 base::AtomicRefCountInc(&num_pending_resizes_);
274 274
275 g_present_thread_pool.Pointer()->PostTask( 275 g_present_thread_pool.Pointer()->PostTask(
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 return; 422 return;
423 423
424 size_ = size; 424 size_ = size;
425 425
426 device_->Clear(0, NULL, D3DCLEAR_TARGET, 0xFFFFFFFF, 0, 0); 426 device_->Clear(0, NULL, D3DCLEAR_TARGET, 0xFFFFFFFF, 0, 0);
427 } 427 }
428 428
429 void AcceleratedSurface::DoPresentAndAcknowledge( 429 void AcceleratedSurface::DoPresentAndAcknowledge(
430 const gfx::Size& size, 430 const gfx::Size& size,
431 int64 surface_id, 431 int64 surface_id,
432 base::Closure completion_task) { 432 const base::Closure& completion_task) {
433 TRACE_EVENT1("surface", "DoPresentAndAcknowledge", "surface_id", surface_id); 433 TRACE_EVENT1("surface", "DoPresentAndAcknowledge", "surface_id", surface_id);
434 434
435 HRESULT hr; 435 HRESULT hr;
436 436
437 base::AutoLock locked(lock_); 437 base::AutoLock locked(lock_);
438 438
439 // Ensure the task is always run and while the lock is taken. 439 // Ensure the task is always run and while the lock is taken.
440 base::ScopedClosureRunner scoped_completion_runner(completion_task); 440 base::ScopedClosureRunner scoped_completion_runner(completion_task);
441 441
442 if (!window_) 442 if (!window_)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 completion_task); 511 completion_task);
512 } 512 }
513 513
514 { 514 {
515 TRACE_EVENT0("surface", "Present"); 515 TRACE_EVENT0("surface", "Present");
516 hr = device_->Present(&rect, &rect, NULL, NULL); 516 hr = device_->Present(&rect, &rect, NULL, NULL);
517 if (FAILED(hr)) 517 if (FAILED(hr))
518 return; 518 return;
519 } 519 }
520 } 520 }
OLDNEW
« no previous file with comments | « ui/gfx/surface/accelerated_surface_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698