| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 if (!surface_.get()) | 67 if (!surface_.get()) |
| 68 return false; | 68 return false; |
| 69 | 69 |
| 70 if (!helper_->Initialize()) | 70 if (!helper_->Initialize()) |
| 71 return false; | 71 return false; |
| 72 | 72 |
| 73 GpuChannel* parent_channel = manager->LookupChannel(handle_.parent_client_id); | 73 GpuChannel* parent_channel = manager->LookupChannel(handle_.parent_client_id); |
| 74 if (parent_channel) { | 74 if (parent_channel) { |
| 75 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 75 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 76 if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess)) | 76 if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess)) |
| 77 helper_->SetPreemptByCounter(parent_channel->MessagesPendingCount()); | 77 helper_->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 void TextureImageTransportSurface::Destroy() { | 83 void TextureImageTransportSurface::Destroy() { |
| 84 if (surface_.get()) | 84 if (surface_.get()) |
| 85 surface_ = NULL; | 85 surface_ = NULL; |
| 86 | 86 |
| 87 helper_->Destroy(); | 87 helper_->Destroy(); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 // at which point we consume the correct texture back. | 481 // at which point we consume the correct texture back. |
| 482 mailbox_manager_->ProduceTexture( | 482 mailbox_manager_->ProduceTexture( |
| 483 GL_TEXTURE_2D, | 483 GL_TEXTURE_2D, |
| 484 mailbox_name(texture.surface_handle), | 484 mailbox_name(texture.surface_handle), |
| 485 definition.release(), | 485 definition.release(), |
| 486 NULL); | 486 NULL); |
| 487 texture.service_id = 0; | 487 texture.service_id = 0; |
| 488 } | 488 } |
| 489 | 489 |
| 490 } // namespace content | 490 } // namespace content |
| OLD | NEW |