| Index: content/common/gpu/gpu_channel.cc
|
| diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
|
| index c12c762c6004f725973182513535274cc6ac2cc7..a416d3d6ba0c22d68fce32534da6a5f67318bfd8 100644
|
| --- a/content/common/gpu/gpu_channel.cc
|
| +++ b/content/common/gpu/gpu_channel.cc
|
| @@ -13,6 +13,7 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/command_line.h"
|
| +#include "base/macros.h"
|
| #include "base/message_loop/message_loop_proxy.h"
|
| #include "base/stl_util.h"
|
| #include "base/strings/string_util.h"
|
| @@ -672,6 +673,7 @@ bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
|
| OnCreateOffscreenCommandBuffer)
|
| IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer,
|
| OnDestroyCommandBuffer)
|
| + IPC_MESSAGE_HANDLER(GpuMsg_CreateJpegDecoder, OnCreateJpegDecoder)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
| DCHECK(handled) << msg.type();
|
| @@ -793,6 +795,22 @@ void GpuChannel::OnDestroyCommandBuffer(int32 route_id) {
|
| }
|
| }
|
|
|
| +void GpuChannel::OnCreateJpegDecoder(int32 route_id, bool* succeeded) {
|
| + scoped_ptr<content::GpuJpegDecodeAccelerator> decoder(
|
| + new GpuJpegDecodeAccelerator(this, route_id, io_message_loop_));
|
| +
|
| + *succeeded = decoder->Initialize();
|
| + DCHECK(jpeg_decoder_map_.get(route_id) == nullptr);
|
| + jpeg_decoder_map_.set(route_id, decoder.Pass());
|
| +}
|
| +
|
| +void GpuChannel::ReleaseJpegDecoder(int32 route_id) {
|
| + scoped_ptr<content::GpuJpegDecodeAccelerator> decoder =
|
| + jpeg_decoder_map_.take_and_erase(route_id);
|
| + DCHECK(decoder);
|
| + ignore_result(decoder.release());
|
| +}
|
| +
|
| void GpuChannel::MessageProcessed() {
|
| messages_processed_++;
|
| if (preempting_flag_.get()) {
|
|
|