OLD | NEW |
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/renderer/gpu/stream_texture_host_android.h" | 5 #include "content/renderer/gpu/stream_texture_host_android.h" |
6 | 6 |
7 #include "content/renderer/render_thread_impl.h" | 7 #include "content/renderer/render_thread_impl.h" |
8 #include "gpu/ipc/client/gpu_channel_host.h" | 8 #include "gpu/ipc/client/gpu_channel_host.h" |
9 #include "gpu/ipc/common/gpu_messages.h" | 9 #include "gpu/ipc/common/gpu_messages.h" |
10 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 } | 35 } |
36 | 36 |
37 return false; | 37 return false; |
38 } | 38 } |
39 | 39 |
40 bool StreamTextureHost::OnMessageReceived(const IPC::Message& message) { | 40 bool StreamTextureHost::OnMessageReceived(const IPC::Message& message) { |
41 bool handled = true; | 41 bool handled = true; |
42 IPC_BEGIN_MESSAGE_MAP(StreamTextureHost, message) | 42 IPC_BEGIN_MESSAGE_MAP(StreamTextureHost, message) |
43 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_FrameAvailable, | 43 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_FrameAvailable, |
44 OnFrameAvailable); | 44 OnFrameAvailable); |
45 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_MatrixChanged, | |
46 OnMatrixChanged); | |
47 IPC_MESSAGE_UNHANDLED(handled = false) | 45 IPC_MESSAGE_UNHANDLED(handled = false) |
48 IPC_END_MESSAGE_MAP() | 46 IPC_END_MESSAGE_MAP() |
49 DCHECK(handled); | 47 DCHECK(handled); |
50 return handled; | 48 return handled; |
51 } | 49 } |
52 | 50 |
53 void StreamTextureHost::OnChannelError() { | 51 void StreamTextureHost::OnChannelError() { |
54 } | 52 } |
55 | 53 |
56 void StreamTextureHost::OnFrameAvailable() { | 54 void StreamTextureHost::OnFrameAvailable() { |
57 if (listener_) | 55 if (listener_) |
58 listener_->OnFrameAvailable(); | 56 listener_->OnFrameAvailable(); |
59 } | 57 } |
60 | 58 |
61 void StreamTextureHost::OnMatrixChanged( | |
62 const GpuStreamTextureMsg_MatrixChanged_Params& params) { | |
63 static_assert(sizeof(params) == sizeof(float) * 16, | |
64 "bad GpuStreamTextureMsg MatrixChanged_Params format"); | |
65 if (listener_) | |
66 listener_->OnMatrixChanged((const float*)¶ms); | |
67 } | |
68 | |
69 } // namespace content | 59 } // namespace content |
OLD | NEW |