Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(715)

Side by Side Diff: trunk/src/content/common/gpu/image_transport_surface_android.cc

Issue 189373012: Revert 255481 "Remove --ui-prioritize-in-gpu-process" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 GetHelper()->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); 96 const CommandLine* command_line = CommandLine::ForCurrentProcess();
97 if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess))
98 GetHelper()->SetPreemptByFlag(parent_channel->GetPreemptionFlag());
99 }
97 100
98 return true; 101 return true;
99 } 102 }
100 103
101 bool ImageTransportSurfaceAndroid::OnMakeCurrent(gfx::GLContext* context) { 104 bool ImageTransportSurfaceAndroid::OnMakeCurrent(gfx::GLContext* context) {
102 DidAccessGpu(); 105 DidAccessGpu();
103 return PassThroughImageTransportSurface::OnMakeCurrent(context); 106 return PassThroughImageTransportSurface::OnMakeCurrent(context);
104 } 107 }
105 108
106 bool ImageTransportSurfaceAndroid::SwapBuffers() { 109 bool ImageTransportSurfaceAndroid::SwapBuffers() {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 if (window) 185 if (window)
183 ANativeWindow_release(window); 186 ANativeWindow_release(window);
184 if (!initialize_success) 187 if (!initialize_success)
185 return scoped_refptr<gfx::GLSurface>(); 188 return scoped_refptr<gfx::GLSurface>();
186 189
187 return scoped_refptr<gfx::GLSurface>( 190 return scoped_refptr<gfx::GLSurface>(
188 new DirectSurfaceAndroid(manager, stub, surface.get(), false)); 191 new DirectSurfaceAndroid(manager, stub, surface.get(), false));
189 } 192 }
190 193
191 } // namespace content 194 } // namespace content
OLDNEW
« no previous file with comments | « trunk/src/content/browser/gpu/gpu_process_host.cc ('k') | trunk/src/content/common/gpu/texture_image_transport_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698