| Index: gpu/command_buffer/service/gpu_processor.cc
|
| ===================================================================
|
| --- gpu/command_buffer/service/gpu_processor.cc (revision 42644)
|
| +++ gpu/command_buffer/service/gpu_processor.cc (working copy)
|
| @@ -3,6 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/callback.h"
|
| +#include "base/compiler_specific.h"
|
| #include "base/message_loop.h"
|
| #include "gpu/command_buffer/service/gpu_processor.h"
|
|
|
| @@ -12,7 +13,8 @@
|
|
|
| GPUProcessor::GPUProcessor(CommandBuffer* command_buffer)
|
| : command_buffer_(command_buffer),
|
| - commands_per_update_(100) {
|
| + commands_per_update_(100),
|
| + method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
|
| DCHECK(command_buffer);
|
| decoder_.reset(gles2::GLES2Decoder::Create(&group_));
|
| decoder_->set_engine(this);
|
| @@ -23,13 +25,15 @@
|
| CommandParser* parser,
|
| int commands_per_update)
|
| : command_buffer_(command_buffer),
|
| - commands_per_update_(commands_per_update) {
|
| + commands_per_update_(commands_per_update),
|
| + method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
|
| DCHECK(command_buffer);
|
| decoder_.reset(decoder);
|
| parser_.reset(parser);
|
| }
|
|
|
| GPUProcessor::~GPUProcessor() {
|
| + Destroy();
|
| }
|
|
|
| void GPUProcessor::ProcessCommands() {
|
| @@ -59,7 +63,8 @@
|
|
|
| if (!parser_->IsEmpty()) {
|
| MessageLoop::current()->PostTask(
|
| - FROM_HERE, NewRunnableMethod(this, &GPUProcessor::ProcessCommands));
|
| + FROM_HERE,
|
| + method_factory_.NewRunnableMethod(&GPUProcessor::ProcessCommands));
|
| }
|
| }
|
|
|
| @@ -83,6 +88,10 @@
|
| return parser_->get();
|
| }
|
|
|
| +void GPUProcessor::ResizeOffscreenFrameBuffer(const gfx::Size& size) {
|
| + decoder_->ResizeOffscreenFrameBuffer(size);
|
| +}
|
| +
|
| #if defined(OS_MACOSX)
|
| uint64 GPUProcessor::SetWindowSizeForIOSurface(int32 width, int32 height) {
|
| return decoder_->SetWindowSizeForIOSurface(width, height);
|
|
|