| 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 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 77 helper_->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); |
| 78 if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess)) | |
| 79 helper_->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); | |
| 80 } | |
| 81 | 78 |
| 82 return true; | 79 return true; |
| 83 } | 80 } |
| 84 | 81 |
| 85 void TextureImageTransportSurface::Destroy() { | 82 void TextureImageTransportSurface::Destroy() { |
| 86 if (surface_.get()) | 83 if (surface_.get()) |
| 87 surface_ = NULL; | 84 surface_ = NULL; |
| 88 | 85 |
| 89 helper_->Destroy(); | 86 helper_->Destroy(); |
| 90 } | 87 } |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 448 |
| 452 #ifndef NDEBUG | 449 #ifndef NDEBUG |
| 453 GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); | 450 GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); |
| 454 if (status != GL_FRAMEBUFFER_COMPLETE) { | 451 if (status != GL_FRAMEBUFFER_COMPLETE) { |
| 455 DLOG(FATAL) << "Framebuffer incomplete: " << status; | 452 DLOG(FATAL) << "Framebuffer incomplete: " << status; |
| 456 } | 453 } |
| 457 #endif | 454 #endif |
| 458 } | 455 } |
| 459 | 456 |
| 460 } // namespace content | 457 } // namespace content |
| OLD | NEW |