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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 255713008: Change glimage to accept a type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 6 years, 7 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/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 NOTREACHED(); 1128 NOTREACHED();
1129 } 1129 }
1130 1130
1131 void RenderThreadImpl::DeleteImage(int32 image_id, int32 sync_point) { 1131 void RenderThreadImpl::DeleteImage(int32 image_id, int32 sync_point) {
1132 NOTREACHED(); 1132 NOTREACHED();
1133 } 1133 }
1134 1134
1135 scoped_ptr<gfx::GpuMemoryBuffer> RenderThreadImpl::AllocateGpuMemoryBuffer( 1135 scoped_ptr<gfx::GpuMemoryBuffer> RenderThreadImpl::AllocateGpuMemoryBuffer(
1136 size_t width, 1136 size_t width,
1137 size_t height, 1137 size_t height,
1138 unsigned internalformat) { 1138 unsigned internalformat,
1139 unsigned usage) {
1139 DCHECK(allocate_gpu_memory_buffer_thread_checker_.CalledOnValidThread()); 1140 DCHECK(allocate_gpu_memory_buffer_thread_checker_.CalledOnValidThread());
1140 1141
1141 if (!GpuMemoryBufferImpl::IsFormatValid(internalformat)) 1142 if (!GpuMemoryBufferImpl::IsFormatValid(internalformat))
1142 return scoped_ptr<gfx::GpuMemoryBuffer>(); 1143 return scoped_ptr<gfx::GpuMemoryBuffer>();
1143 1144
1144 gfx::GpuMemoryBufferHandle handle; 1145 gfx::GpuMemoryBufferHandle handle;
1145 bool success; 1146 bool success;
1146 IPC::Message* message = 1147 IPC::Message* message = new ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer(
1147 new ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer(width, 1148 width, height, internalformat, usage, &handle);
1148 height,
1149 internalformat,
1150 &handle);
1151 1149
1152 // Allow calling this from the compositor thread. 1150 // Allow calling this from the compositor thread.
1153 if (base::MessageLoop::current() == message_loop()) 1151 if (base::MessageLoop::current() == message_loop())
1154 success = ChildThread::Send(message); 1152 success = ChildThread::Send(message);
1155 else 1153 else
1156 success = sync_message_filter()->Send(message); 1154 success = sync_message_filter()->Send(message);
1157 1155
1158 if (!success) 1156 if (!success)
1159 return scoped_ptr<gfx::GpuMemoryBuffer>(); 1157 return scoped_ptr<gfx::GpuMemoryBuffer>();
1160 1158
1161 return GpuMemoryBufferImpl::Create( 1159 return GpuMemoryBufferImpl::Create(
1162 handle, 1160 handle, gfx::Size(width, height), internalformat)
1163 gfx::Size(width, height), 1161 .PassAs<gfx::GpuMemoryBuffer>();
1164 internalformat).PassAs<gfx::GpuMemoryBuffer>();
1165 } 1162 }
1166 1163
1167 void RenderThreadImpl::AcceptConnection( 1164 void RenderThreadImpl::AcceptConnection(
1168 const mojo::String& service_name, 1165 const mojo::String& service_name,
1169 mojo::ScopedMessagePipeHandle message_pipe) { 1166 mojo::ScopedMessagePipeHandle message_pipe) {
1170 // TODO(darin): Invent some kind of registration system to use here. 1167 // TODO(darin): Invent some kind of registration system to use here.
1171 if (service_name.To<base::StringPiece>() == kRendererService_WebUISetup) { 1168 if (service_name.To<base::StringPiece>() == kRendererService_WebUISetup) {
1172 WebUISetupImpl::Bind(message_pipe.Pass()); 1169 WebUISetupImpl::Bind(message_pipe.Pass());
1173 } else { 1170 } else {
1174 NOTREACHED() << "Unknown service name"; 1171 NOTREACHED() << "Unknown service name";
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 hidden_widget_count_--; 1489 hidden_widget_count_--;
1493 1490
1494 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1491 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1495 return; 1492 return;
1496 } 1493 }
1497 1494
1498 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1495 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1499 } 1496 }
1500 1497
1501 } // namespace content 1498 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698