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

Unified Diff: content/browser/android/in_process/synchronous_compositor_factory_impl.cc

Issue 1356463002: Revert of cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/in_process/synchronous_compositor_factory_impl.cc
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
index 9888c2d0a38fd591b2af32d2a01d0bf84846fc05..b90edd69a2f25dd9b17141dcebeb9b44df9be868 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
@@ -24,7 +24,6 @@
#include "content/renderer/render_thread_impl.h"
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
#include "gpu/command_buffer/client/gl_in_process_context.h"
-#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "ui/gl/android/surface_texture.h"
#include "ui/gl/gl_surface.h"
@@ -170,40 +169,11 @@
scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) {
scoped_refptr<cc::ContextProvider> onscreen_context =
CreateContextProviderForCompositor(surface_id, RENDER_COMPOSITOR_CONTEXT);
-
- bool shared_worker_context_lost = false;
- if (shared_worker_context_) {
- // Note: If context is lost, we delete reference after releasing the lock.
- base::AutoLock lock(*shared_worker_context_->GetLock());
- if (shared_worker_context_->ContextGL()->GetGraphicsResetStatusKHR() !=
- GL_NO_ERROR) {
- shared_worker_context_lost = true;
- }
- }
- // Note: shared worker context support requires |use_ipc_command_buffer_|.
- if (use_ipc_command_buffer_ &&
- (!shared_worker_context_ || shared_worker_context_lost)) {
- // TODO(reveman): This limit is based on the usage required by async
- // uploads. Determine what a good limit is now that async uploads are
- // no longer used.
- unsigned int mapped_memory_reclaim_limit =
- (base::SysInfo::IsLowEndDevice() ? 2 : 6) * 1024 * 1024;
- WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits mem_limits;
- mem_limits.mapped_memory_reclaim_limit = mapped_memory_reclaim_limit;
- scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context =
- CreateContext3D(0, GetDefaultAttribs(), mem_limits);
- shared_worker_context_ =
- make_scoped_refptr(new SynchronousCompositorContextProvider(
- context.Pass(), RENDER_WORKER_CONTEXT));
- if (!shared_worker_context_->BindToCurrentThread())
- shared_worker_context_ = nullptr;
- if (shared_worker_context_)
- shared_worker_context_->SetupLock();
- }
+ scoped_refptr<cc::ContextProvider> worker_context =
+ CreateContextProviderForCompositor(0, RENDER_WORKER_CONTEXT);
return make_scoped_ptr(new SynchronousCompositorOutputSurface(
- onscreen_context, shared_worker_context_, routing_id,
- frame_swap_message_queue));
+ onscreen_context, worker_context, routing_id, frame_swap_message_queue));
}
InputHandlerManagerClient*
@@ -241,9 +211,6 @@
// This is half of what RenderWidget uses because synchronous compositor
// pipeline is only one frame deep. But twice of half for low end here
// because 16bit texture is not supported.
- // TODO(reveman): This limit is based on the usage required by async
- // uploads. Determine what a good limit is now that async uploads are
- // no longer used.
unsigned int mapped_memory_reclaim_limit =
(base::SysInfo::IsLowEndDevice() ? 2 : 6) * 1024 * 1024;
blink::WebGraphicsContext3D::Attributes attributes = GetDefaultAttribs();

Powered by Google App Engine
This is Rietveld 408576698