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

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

Issue 208213003: Plumb overlay processing into DirectRenderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Introduced ScopedExportLock Created 6 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 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 FROM_HERE, sync_point_callbacks_[i]); 49 FROM_HERE, sync_point_callbacks_[i]);
50 } 50 }
51 sync_point_callbacks_.clear(); 51 sync_point_callbacks_.clear();
52 } 52 }
53 53
54 void TestContextSupport::SetSurfaceVisibleCallback( 54 void TestContextSupport::SetSurfaceVisibleCallback(
55 const SurfaceVisibleCallback& set_visible_callback) { 55 const SurfaceVisibleCallback& set_visible_callback) {
56 set_visible_callback_ = set_visible_callback; 56 set_visible_callback_ = set_visible_callback;
57 } 57 }
58 58
59 void TestContextSupport::SetScheduleOverlayPlaneCallback(
60 const ScheduleOverlayPlaneCallback& schedule_overlay_plane_callback) {
61 schedule_overlay_plane_callback_ = schedule_overlay_plane_callback;
62 }
63
59 void TestContextSupport::Swap() { 64 void TestContextSupport::Swap() {
60 last_swap_type_ = SWAP; 65 last_swap_type_ = SWAP;
61 base::MessageLoop::current()->PostTask( 66 base::MessageLoop::current()->PostTask(
62 FROM_HERE, base::Bind(&TestContextSupport::OnSwapBuffersComplete, 67 FROM_HERE, base::Bind(&TestContextSupport::OnSwapBuffersComplete,
63 weak_ptr_factory_.GetWeakPtr())); 68 weak_ptr_factory_.GetWeakPtr()));
64 } 69 }
65 70
66 void TestContextSupport::PartialSwapBuffers(const gfx::Rect& sub_buffer) { 71 void TestContextSupport::PartialSwapBuffers(const gfx::Rect& sub_buffer) {
67 last_swap_type_ = PARTIAL_SWAP; 72 last_swap_type_ = PARTIAL_SWAP;
68 last_partial_swap_rect_ = sub_buffer; 73 last_partial_swap_rect_ = sub_buffer;
69 base::MessageLoop::current()->PostTask( 74 base::MessageLoop::current()->PostTask(
70 FROM_HERE, base::Bind(&TestContextSupport::OnSwapBuffersComplete, 75 FROM_HERE, base::Bind(&TestContextSupport::OnSwapBuffersComplete,
71 weak_ptr_factory_.GetWeakPtr())); 76 weak_ptr_factory_.GetWeakPtr()));
72 } 77 }
73 78
79 void TestContextSupport::ScheduleOverlayPlane(
80 int plane_z_order,
81 unsigned plane_transform,
82 const gpu::Mailbox& overlay_texture,
83 const gfx::Rect& display_bounds,
84 const gfx::RectF& uv_rect) {
85 if (!schedule_overlay_plane_callback_.is_null()) {
86 schedule_overlay_plane_callback_.Run(plane_z_order,
87 plane_transform,
88 overlay_texture,
89 display_bounds,
90 uv_rect);
91 }
92 }
93
74 void TestContextSupport::SetSwapBuffersCompleteCallback( 94 void TestContextSupport::SetSwapBuffersCompleteCallback(
75 const base::Closure& callback) { 95 const base::Closure& callback) {
76 swap_buffers_complete_callback_ = callback; 96 swap_buffers_complete_callback_ = callback;
77 } 97 }
78 98
79 void TestContextSupport::OnSwapBuffersComplete() { 99 void TestContextSupport::OnSwapBuffersComplete() {
80 if (!swap_buffers_complete_callback_.is_null()) 100 if (!swap_buffers_complete_callback_.is_null())
81 swap_buffers_complete_callback_.Run(); 101 swap_buffers_complete_callback_.Run();
82 } 102 }
83 103
84 } // namespace cc 104 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698