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/image_transport_surface.h" | 5 #include "content/common/gpu/image_transport_surface.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 #include "content/common/gpu/gpu_channel_manager.h" | 10 #include "content/common/gpu/gpu_channel_manager.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 bool ImageTransportSurfaceAndroid::Initialize() { | 86 bool ImageTransportSurfaceAndroid::Initialize() { |
87 if (!surface()) | 87 if (!surface()) |
88 return false; | 88 return false; |
89 | 89 |
90 if (!PassThroughImageTransportSurface::Initialize()) | 90 if (!PassThroughImageTransportSurface::Initialize()) |
91 return false; | 91 return false; |
92 | 92 |
93 GpuChannel* parent_channel = | 93 GpuChannel* parent_channel = |
94 GetHelper()->manager()->LookupChannel(parent_client_id_); | 94 GetHelper()->manager()->LookupChannel(parent_client_id_); |
95 if (parent_channel) { | 95 if (parent_channel) |
96 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 96 GetHelper()->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); |
97 if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess)) | |
98 GetHelper()->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); | |
99 } | |
100 | 97 |
101 return true; | 98 return true; |
102 } | 99 } |
103 | 100 |
104 bool ImageTransportSurfaceAndroid::OnMakeCurrent(gfx::GLContext* context) { | 101 bool ImageTransportSurfaceAndroid::OnMakeCurrent(gfx::GLContext* context) { |
105 DidAccessGpu(); | 102 DidAccessGpu(); |
106 return PassThroughImageTransportSurface::OnMakeCurrent(context); | 103 return PassThroughImageTransportSurface::OnMakeCurrent(context); |
107 } | 104 } |
108 | 105 |
109 bool ImageTransportSurfaceAndroid::SwapBuffers() { | 106 bool ImageTransportSurfaceAndroid::SwapBuffers() { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 if (window) | 182 if (window) |
186 ANativeWindow_release(window); | 183 ANativeWindow_release(window); |
187 if (!initialize_success) | 184 if (!initialize_success) |
188 return scoped_refptr<gfx::GLSurface>(); | 185 return scoped_refptr<gfx::GLSurface>(); |
189 | 186 |
190 return scoped_refptr<gfx::GLSurface>( | 187 return scoped_refptr<gfx::GLSurface>( |
191 new DirectSurfaceAndroid(manager, stub, surface.get(), false)); | 188 new DirectSurfaceAndroid(manager, stub, surface.get(), false)); |
192 } | 189 } |
193 | 190 |
194 } // namespace content | 191 } // namespace content |
OLD | NEW |