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/common/gpu/client/gpu_channel_host.h" | 7 #include "content/common/gpu/client/gpu_channel_host.h" |
8 #include "content/common/gpu/gpu_messages.h" | 8 #include "content/common/gpu/gpu_messages.h" |
9 #include "content/renderer/render_thread_impl.h" | 9 #include "content/renderer/render_thread_impl.h" |
10 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 OnFrameAvailable); | 46 OnFrameAvailable); |
47 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_MatrixChanged, | 47 IPC_MESSAGE_HANDLER(GpuStreamTextureMsg_MatrixChanged, |
48 OnMatrixChanged); | 48 OnMatrixChanged); |
49 IPC_MESSAGE_UNHANDLED(handled = false) | 49 IPC_MESSAGE_UNHANDLED(handled = false) |
50 IPC_END_MESSAGE_MAP() | 50 IPC_END_MESSAGE_MAP() |
51 DCHECK(handled); | 51 DCHECK(handled); |
52 return handled; | 52 return handled; |
53 } | 53 } |
54 | 54 |
55 void StreamTextureHost::EstablishPeer(int32 primary_id, int32 secondary_id) { | 55 void StreamTextureHost::EstablishPeer(int32 primary_id, int32 secondary_id) { |
56 if (channel_) { | 56 if (channel_.get()) { |
57 channel_->Send(new GpuChannelMsg_EstablishStreamTexture( | 57 channel_->Send(new GpuChannelMsg_EstablishStreamTexture( |
58 stream_id_, primary_id, secondary_id)); | 58 stream_id_, primary_id, secondary_id)); |
59 } | 59 } |
60 } | 60 } |
61 void StreamTextureHost::OnChannelError() { | 61 void StreamTextureHost::OnChannelError() { |
62 } | 62 } |
63 | 63 |
64 void StreamTextureHost::OnFrameAvailable() { | 64 void StreamTextureHost::OnFrameAvailable() { |
65 if (listener_) | 65 if (listener_) |
66 listener_->OnFrameAvailable(); | 66 listener_->OnFrameAvailable(); |
67 } | 67 } |
68 | 68 |
69 void StreamTextureHost::OnMatrixChanged( | 69 void StreamTextureHost::OnMatrixChanged( |
70 const GpuStreamTextureMsg_MatrixChanged_Params& params) { | 70 const GpuStreamTextureMsg_MatrixChanged_Params& params) { |
71 COMPILE_ASSERT(sizeof(params) == sizeof(float) * 16, | 71 COMPILE_ASSERT(sizeof(params) == sizeof(float) * 16, |
72 bad_GpuStreamTextureMsg_MatrixChanged_Params_format); | 72 bad_GpuStreamTextureMsg_MatrixChanged_Params_format); |
73 if (listener_) | 73 if (listener_) |
74 listener_->OnMatrixChanged((const float*)¶ms); | 74 listener_->OnMatrixChanged((const float*)¶ms); |
75 } | 75 } |
76 | 76 |
77 } // namespace content | 77 } // namespace content |
OLD | NEW |