summaryrefslogtreecommitdiffstats
path: root/content/common/gpu/image_transport_surface.cc
diff options
context:
space:
mode:
authorpiman <piman@chromium.org>2015-09-24 14:12:29 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-24 21:13:17 +0000
commit4db52c1398011b124745567b5383572c2f319135 (patch)
tree23d0c02246e06084935a01bbb72de44a0334581a /content/common/gpu/image_transport_surface.cc
parent981d2fe6ea26648fe3714e5aceda1dd7bc144007 (diff)
downloadchromium_src-4db52c1398011b124745567b5383572c2f319135.zip
chromium_src-4db52c1398011b124745567b5383572c2f319135.tar.gz
chromium_src-4db52c1398011b124745567b5383572c2f319135.tar.bz2
Make channel preemption not require view contexts for hookup
Instead have a single preemption flag on the GpuChannelManager, and make the browser channel always be the one preempting, and the child channels always be the ones being preempted (if --ui-prioritize-in-gpu-process is set). This reflects our current usage, and is much simpler. It means we don't need parent_client_id in GLSurfaceHandle any more, and all the renderer view surfaces are identical, so we don't need their surface ids. BUG=497658 Review URL: https://codereview.chromium.org/1365563002 Cr-Commit-Position: refs/heads/master@{#350663}
Diffstat (limited to 'content/common/gpu/image_transport_surface.cc')
-rw-r--r--content/common/gpu/image_transport_surface.cc19
1 files changed, 3 insertions, 16 deletions
diff --git a/content/common/gpu/image_transport_surface.cc b/content/common/gpu/image_transport_surface.cc
index efcd04f..1cdbd80 100644
--- a/content/common/gpu/image_transport_surface.cc
+++ b/content/common/gpu/image_transport_surface.cc
@@ -12,7 +12,6 @@
#include "content/common/gpu/gpu_channel_manager.h"
#include "content/common/gpu/gpu_command_buffer_stub.h"
#include "content/common/gpu/gpu_messages.h"
-#include "content/public/common/content_switches.h"
#include "gpu/command_buffer/service/sync_point_manager.h"
#include "ui/gfx/vsync_provider.h"
#include "ui/gl/gl_context.h"
@@ -31,15 +30,6 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateSurface(
const gfx::GLSurfaceHandle& handle) {
scoped_refptr<gfx::GLSurface> surface;
if (handle.transport_type == gfx::NULL_TRANSPORT) {
- GpuChannel* parent_channel = manager->LookupChannel(
- handle.parent_client_id);
- if (parent_channel) {
- const base::CommandLine* command_line =
- base::CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess))
- stub->channel()->SetPreemptByFlag(parent_channel->GetPreemptionFlag());
- }
-
surface = manager->GetDefaultOffscreenSurface();
} else {
surface = CreateNativeSurface(manager, stub, handle);
@@ -109,17 +99,14 @@ void ImageTransportHelper::SendAcceleratedSurfaceBuffersSwapped(
TRACE_EVENT_SCOPE_THREAD,
"GLImpl", static_cast<int>(gfx::GetGLImplementation()),
"width", params.size.width());
- params.surface_id = stub_->surface_id();
+ // On mac, handle_ is a surface id. See
+ // GpuProcessTransportFactory::CreatePerCompositorData
+ params.surface_id = handle_;
params.route_id = route_id_;
manager_->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped(params));
}
#endif
-void ImageTransportHelper::SetPreemptByFlag(
- scoped_refptr<gpu::PreemptionFlag> preemption_flag) {
- stub_->channel()->SetPreemptByFlag(preemption_flag);
-}
-
bool ImageTransportHelper::MakeCurrent() {
gpu::gles2::GLES2Decoder* decoder = Decoder();
if (!decoder)