| 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/pepper/ppb_graphics_3d_impl.h" | 5 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 bound_to_instance_(false), | 45 bound_to_instance_(false), |
| 46 commit_pending_(false), | 46 commit_pending_(false), |
| 47 has_alpha_(false), | 47 has_alpha_(false), |
| 48 use_image_chromium_(false), | 48 use_image_chromium_(false), |
| 49 weak_ptr_factory_(this) { | 49 weak_ptr_factory_(this) { |
| 50 #if defined(OS_MACOSX) | 50 #if defined(OS_MACOSX) |
| 51 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 51 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 52 bool use_image_chromium = | 52 bool use_image_chromium = |
| 53 !command_line->HasSwitch(switches::kDisablePepper3DImageChromium); | 53 !command_line->HasSwitch(switches::kDisablePepper3DImageChromium); |
| 54 use_image_chromium_ = use_image_chromium; | 54 use_image_chromium_ = use_image_chromium; |
| 55 | |
| 56 // TODO(erikchen): Remove this line to enable the feature. | |
| 57 use_image_chromium_ = false; | |
| 58 #endif | 55 #endif |
| 59 } | 56 } |
| 60 | 57 |
| 61 PPB_Graphics3D_Impl::~PPB_Graphics3D_Impl() { | 58 PPB_Graphics3D_Impl::~PPB_Graphics3D_Impl() { |
| 62 // Unset the client before the command_buffer_ is destroyed, similar to how | 59 // Unset the client before the command_buffer_ is destroyed, similar to how |
| 63 // WeakPtrFactory invalidates before it. | 60 // WeakPtrFactory invalidates before it. |
| 64 if (command_buffer_) | 61 if (command_buffer_) |
| 65 command_buffer_->SetGpuControlClient(nullptr); | 62 command_buffer_->SetGpuControlClient(nullptr); |
| 66 } | 63 } |
| 67 | 64 |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 if (!mailboxes_to_reuse_.empty()) { | 382 if (!mailboxes_to_reuse_.empty()) { |
| 386 gpu::Mailbox mailbox = mailboxes_to_reuse_.back(); | 383 gpu::Mailbox mailbox = mailboxes_to_reuse_.back(); |
| 387 mailboxes_to_reuse_.pop_back(); | 384 mailboxes_to_reuse_.pop_back(); |
| 388 return mailbox; | 385 return mailbox; |
| 389 } | 386 } |
| 390 | 387 |
| 391 return gpu::Mailbox::Generate(); | 388 return gpu::Mailbox::Generate(); |
| 392 } | 389 } |
| 393 | 390 |
| 394 } // namespace content | 391 } // namespace content |
| OLD | NEW |