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

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

Issue 455783002: GPU context creation code duplication cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix even more build dependencies Created 6 years, 4 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 45e5aa14d4621f2568fcee9c727eb2d5f7b45407..adcc158d1167921e1029c21cf9bdb18e3c39ddfd 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
@@ -8,6 +8,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/renderer/gpu/frame_swap_message_queue.h"
#include "gpu/command_buffer/client/gl_in_process_context.h"
+#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "ui/gl/android/surface_texture.h"
#include "ui/gl/gl_surface.h"
#include "ui/gl/gl_surface_stub.h"
@@ -32,15 +33,16 @@ blink::WebGraphicsContext3D::Attributes GetDefaultAttribs() {
}
using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
+using webkit::gpu::WebGraphicsContext3DImpl;
scoped_ptr<gpu::GLInProcessContext> CreateOffscreenContext(
const blink::WebGraphicsContext3D::Attributes& attributes) {
const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
- gpu::GLInProcessContextAttribs in_process_attribs;
- WebGraphicsContext3DInProcessCommandBufferImpl::ConvertAttributes(
+ gpu::gles2::ContextCreationAttribHelper in_process_attribs;
+ WebGraphicsContext3DImpl::ConvertAttributes(
attributes, &in_process_attribs);
- in_process_attribs.lose_context_when_out_of_memory = 1;
+ in_process_attribs.lose_context_when_out_of_memory = true;
scoped_ptr<gpu::GLInProcessContext> context(
gpu::GLInProcessContext::Create(NULL /* service */,
@@ -59,10 +61,10 @@ scoped_ptr<gpu::GLInProcessContext> CreateContext(
scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
gpu::GLInProcessContext* share_context) {
const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
- gpu::GLInProcessContextAttribs in_process_attribs;
- WebGraphicsContext3DInProcessCommandBufferImpl::ConvertAttributes(
+ gpu::gles2::ContextCreationAttribHelper in_process_attribs;
+ WebGraphicsContext3DImpl::ConvertAttributes(
GetDefaultAttribs(), &in_process_attribs);
- in_process_attribs.lose_context_when_out_of_memory = 1;
+ in_process_attribs.lose_context_when_out_of_memory = true;
scoped_ptr<gpu::GLInProcessContext> context(
gpu::GLInProcessContext::Create(service,
« no previous file with comments | « cc/test/test_in_process_context_provider.cc ('k') | content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698