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

Side by Side Diff: cc/test/test_context_support.cc

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! 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 | « cc/test/test_context_support.h ('k') | cc/test/tiled_layer_test_common.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/test/test_context_support.h" 5 #include "cc/test/test_context_support.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 set_visible_callback_ = set_visible_callback; 56 set_visible_callback_ = set_visible_callback;
57 } 57 }
58 58
59 void TestContextSupport::Swap() { 59 void TestContextSupport::Swap() {
60 last_swap_type_ = SWAP; 60 last_swap_type_ = SWAP;
61 base::MessageLoop::current()->PostTask( 61 base::MessageLoop::current()->PostTask(
62 FROM_HERE, base::Bind(&TestContextSupport::OnSwapBuffersComplete, 62 FROM_HERE, base::Bind(&TestContextSupport::OnSwapBuffersComplete,
63 weak_ptr_factory_.GetWeakPtr())); 63 weak_ptr_factory_.GetWeakPtr()));
64 } 64 }
65 65
66 void TestContextSupport::PartialSwapBuffers(gfx::Rect sub_buffer) { 66 void TestContextSupport::PartialSwapBuffers(const gfx::Rect& sub_buffer) {
67 last_swap_type_ = PARTIAL_SWAP; 67 last_swap_type_ = PARTIAL_SWAP;
68 last_partial_swap_rect_ = sub_buffer; 68 last_partial_swap_rect_ = sub_buffer;
69 base::MessageLoop::current()->PostTask( 69 base::MessageLoop::current()->PostTask(
70 FROM_HERE, base::Bind(&TestContextSupport::OnSwapBuffersComplete, 70 FROM_HERE, base::Bind(&TestContextSupport::OnSwapBuffersComplete,
71 weak_ptr_factory_.GetWeakPtr())); 71 weak_ptr_factory_.GetWeakPtr()));
72 } 72 }
73 73
74 void TestContextSupport::SetSwapBuffersCompleteCallback( 74 void TestContextSupport::SetSwapBuffersCompleteCallback(
75 const base::Closure& callback) { 75 const base::Closure& callback) {
76 swap_buffers_complete_callback_ = callback; 76 swap_buffers_complete_callback_ = callback;
77 } 77 }
78 78
79 void TestContextSupport::OnSwapBuffersComplete() { 79 void TestContextSupport::OnSwapBuffersComplete() {
80 if (!swap_buffers_complete_callback_.is_null()) 80 if (!swap_buffers_complete_callback_.is_null())
81 swap_buffers_complete_callback_.Run(); 81 swap_buffers_complete_callback_.Run();
82 } 82 }
83 83
84 } // namespace cc 84 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_context_support.h ('k') | cc/test/tiled_layer_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698