| 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/common/gpu/texture_image_transport_surface.h" | 5 #include "content/common/gpu/texture_image_transport_surface.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 GpuChannelManager* manager = helper_->manager(); | 67 GpuChannelManager* manager = helper_->manager(); |
| 68 surface_ = manager->GetDefaultOffscreenSurface(); | 68 surface_ = manager->GetDefaultOffscreenSurface(); |
| 69 if (!surface_.get()) | 69 if (!surface_.get()) |
| 70 return false; | 70 return false; |
| 71 | 71 |
| 72 if (!helper_->Initialize()) | 72 if (!helper_->Initialize()) |
| 73 return false; | 73 return false; |
| 74 | 74 |
| 75 GpuChannel* parent_channel = manager->LookupChannel(handle_.parent_client_id); | 75 GpuChannel* parent_channel = manager->LookupChannel(handle_.parent_client_id); |
| 76 if (parent_channel) | 76 if (parent_channel) { |
| 77 helper_->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); | 77 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 78 if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess)) |
| 79 helper_->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); |
| 80 } |
| 78 | 81 |
| 79 return true; | 82 return true; |
| 80 } | 83 } |
| 81 | 84 |
| 82 void TextureImageTransportSurface::Destroy() { | 85 void TextureImageTransportSurface::Destroy() { |
| 83 if (surface_.get()) | 86 if (surface_.get()) |
| 84 surface_ = NULL; | 87 surface_ = NULL; |
| 85 | 88 |
| 86 helper_->Destroy(); | 89 helper_->Destroy(); |
| 87 } | 90 } |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 451 |
| 449 #ifndef NDEBUG | 452 #ifndef NDEBUG |
| 450 GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); | 453 GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); |
| 451 if (status != GL_FRAMEBUFFER_COMPLETE) { | 454 if (status != GL_FRAMEBUFFER_COMPLETE) { |
| 452 DLOG(FATAL) << "Framebuffer incomplete: " << status; | 455 DLOG(FATAL) << "Framebuffer incomplete: " << status; |
| 453 } | 456 } |
| 454 #endif | 457 #endif |
| 455 } | 458 } |
| 456 | 459 |
| 457 } // namespace content | 460 } // namespace content |
| OLD | NEW |