| Index: content/common/gpu/client/content_gl_context.h
|
| diff --git a/content/renderer/gpu/renderer_gl_context.h b/content/common/gpu/client/content_gl_context.h
|
| similarity index 70%
|
| rename from content/renderer/gpu/renderer_gl_context.h
|
| rename to content/common/gpu/client/content_gl_context.h
|
| index e491e2cccdd6a44f45e8602b90cffb99f02d1beb..e704aa17816a19b045a535711a6d0c4da1adf070 100644
|
| --- a/content/renderer/gpu/renderer_gl_context.h
|
| +++ b/content/common/gpu/client/content_gl_context.h
|
| @@ -3,11 +3,11 @@
|
| // found in the LICENSE file.
|
|
|
| // This API is consistent with other OpenGL setup APIs like window's WGL
|
| -// and pepper's PGL. This API is used to manage OpenGL RendererGLContexts in the
|
| +// and pepper's PGL. This API is used to manage OpenGL ContentGLContexts in the
|
| // Chrome renderer process in a way that is consistent with other platforms.
|
|
|
| -#ifndef CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_
|
| -#define CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_
|
| +#ifndef CONTENT_COMMON_GPU_CLIENT_RENDERER_GL_CONTEXT_H_
|
| +#define CONTENT_COMMON_GPU_CLIENT_RENDERER_GL_CONTEXT_H_
|
| #pragma once
|
|
|
| #include "base/callback.h"
|
| @@ -32,19 +32,17 @@ class GLES2Implementation;
|
| }
|
| }
|
|
|
| -class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext>,
|
| - public base::NonThreadSafe {
|
| +class ContentGLContext : public base::SupportsWeakPtr<ContentGLContext>,
|
| + public base::NonThreadSafe {
|
| public:
|
| // These are the same error codes as used by EGL.
|
| enum Error {
|
| SUCCESS = 0x3000,
|
| - NOT_INITIALIZED = 0x3001,
|
| BAD_ATTRIBUTE = 0x3004,
|
| - BAD_RendererGLContext = 0x3006,
|
| CONTEXT_LOST = 0x300E
|
| };
|
|
|
| - // RendererGLContext configuration attributes. Those in the 16-bit range are
|
| + // ContentGLContext configuration attributes. Those in the 16-bit range are
|
| // the same as used by EGL. Those outside the 16-bit range are unique to
|
| // Chromium. Attributes are matched using a closest fit algorithm.
|
| enum Attribute {
|
| @@ -83,11 +81,11 @@ class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext>,
|
| // have completed.
|
| static bool Terminate();
|
|
|
| - ~RendererGLContext();
|
| + ~ContentGLContext();
|
|
|
| - // Create a RendererGLContext that renders directly to a view. The view and
|
| + // Create a ContentGLContext that renders directly to a view. The view and
|
| // the associated window must not be destroyed until the returned
|
| - // RendererGLContext has been destroyed, otherwise the GPU process might
|
| + // ContentGLContext has been destroyed, otherwise the GPU process might
|
| // attempt to render to an invalid window handle.
|
| //
|
| // NOTE: on Mac OS X, this entry point is only used to set up the
|
| @@ -102,27 +100,27 @@ class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext>,
|
| // The render_view_id is currently also only used on Mac OS X.
|
| // TODO(kbr): clean up the arguments to this function and make them
|
| // more cross-platform.
|
| - static RendererGLContext* CreateViewContext(
|
| + static ContentGLContext* CreateViewContext(
|
| GpuChannelHost* channel,
|
| int32 surface_id,
|
| - RendererGLContext* share_group,
|
| + ContentGLContext* share_group,
|
| const char* allowed_extensions,
|
| const int32* attrib_list,
|
| const GURL& active_url,
|
| gfx::GpuPreference gpu_preference);
|
|
|
| - // Create a RendererGLContext that renders to an offscreen frame buffer. If
|
| - // parent is not NULL, that RendererGLContext can access a copy of the created
|
| - // RendererGLContext's frame buffer that is updated every time SwapBuffers is
|
| - // called. It is not as general as shared RendererGLContexts in other
|
| + // Create a ContentGLContext that renders to an offscreen frame buffer. If
|
| + // parent is not NULL, that ContentGLContext can access a copy of the created
|
| + // ContentGLContext's frame buffer that is updated every time SwapBuffers is
|
| + // called. It is not as general as shared ContentGLContexts in other
|
| // implementations of OpenGL. If parent is not NULL, it must be used on the
|
| - // same thread as the parent. A child RendererGLContext may not outlive its
|
| + // same thread as the parent. A child ContentGLContext may not outlive its
|
| // parent. attrib_list must be NULL or a NONE-terminated list of
|
| // attribute/value pairs.
|
| - static RendererGLContext* CreateOffscreenContext(
|
| + static ContentGLContext* CreateOffscreenContext(
|
| GpuChannelHost* channel,
|
| const gfx::Size& size,
|
| - RendererGLContext* share_group,
|
| + ContentGLContext* share_group,
|
| const char* allowed_extensions,
|
| const int32* attrib_list,
|
| const GURL& active_url,
|
| @@ -130,30 +128,30 @@ class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext>,
|
|
|
| // Sets the parent context. If any parent textures have been created for
|
| // another parent, it is important to delete them before changing the parent.
|
| - bool SetParent(RendererGLContext* parent);
|
| + bool SetParent(ContentGLContext* parent);
|
|
|
| - // For an offscreen frame buffer RendererGLContext, return the texture ID with
|
| - // respect to the parent RendererGLContext. Returns zero if RendererGLContext
|
| + // For an offscreen frame buffer ContentGLContext, return the texture ID with
|
| + // respect to the parent ContentGLContext. Returns zero if ContentGLContext
|
| // does not have a parent.
|
| uint32 GetParentTextureId();
|
|
|
| - // Create a new texture in the parent's RendererGLContext. Returns zero if
|
| - // RendererGLContext does not have a parent.
|
| + // Create a new texture in the parent's ContentGLContext. Returns zero if
|
| + // ContentGLContext does not have a parent.
|
| uint32 CreateParentTexture(const gfx::Size& size);
|
|
|
| - // Deletes a texture in the parent's RendererGLContext.
|
| + // Deletes a texture in the parent's ContentGLContext.
|
| void DeleteParentTexture(uint32 texture);
|
|
|
| void SetContextLostCallback(
|
| const base::Callback<void(ContextLostReason)>& callback);
|
|
|
| - // Set the current RendererGLContext for the calling thread.
|
| - static bool MakeCurrent(RendererGLContext* context);
|
| + // Set the current ContentGLContext for the calling thread.
|
| + static bool MakeCurrent(ContentGLContext* context);
|
|
|
| - // For a view RendererGLContext, display everything that has been rendered
|
| - // since the last call. For an offscreen RendererGLContext, resolve everything
|
| + // For a view ContentGLContext, display everything that has been rendered
|
| + // since the last call. For an offscreen ContentGLContext, resolve everything
|
| // that has been rendered since the last call to a copy that can be accessed
|
| - // by the parent RendererGLContext.
|
| + // by the parent ContentGLContext.
|
| bool SwapBuffers();
|
|
|
| // Run the task once the channel has been flushed. Takes care of deleting the
|
| @@ -166,26 +164,26 @@ class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext>,
|
| // TODO(gman): Remove this
|
| void DisableShaderTranslation();
|
|
|
| - // Allows direct access to the GLES2 implementation so a RendererGLContext
|
| + // Allows direct access to the GLES2 implementation so a ContentGLContext
|
| // can be used without making it current.
|
| gpu::gles2::GLES2Implementation* GetImplementation();
|
|
|
| // Return the current error.
|
| Error GetError();
|
|
|
| - // Return true if GPU process reported RendererGLContext lost or there was a
|
| + // Return true if GPU process reported ContentGLContext lost or there was a
|
| // problem communicating with the GPU process.
|
| bool IsCommandBufferContextLost();
|
|
|
| CommandBufferProxy* GetCommandBufferProxy();
|
|
|
| private:
|
| - explicit RendererGLContext(GpuChannelHost* channel);
|
| + explicit ContentGLContext(GpuChannelHost* channel);
|
|
|
| bool Initialize(bool onscreen,
|
| int32 surface_id,
|
| const gfx::Size& size,
|
| - RendererGLContext* share_group,
|
| + ContentGLContext* share_group,
|
| const char* allowed_extensions,
|
| const int32* attrib_list,
|
| const GURL& active_url,
|
| @@ -195,7 +193,7 @@ class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext>,
|
| void OnContextLost();
|
|
|
| scoped_refptr<GpuChannelHost> channel_;
|
| - base::WeakPtr<RendererGLContext> parent_;
|
| + base::WeakPtr<ContentGLContext> parent_;
|
| base::Callback<void(ContextLostReason)> context_lost_callback_;
|
| uint32 parent_texture_id_;
|
| CommandBufferProxy* command_buffer_;
|
| @@ -205,7 +203,7 @@ class RendererGLContext : public base::SupportsWeakPtr<RendererGLContext>,
|
| Error last_error_;
|
| int frame_number_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(RendererGLContext);
|
| + DISALLOW_COPY_AND_ASSIGN(ContentGLContext);
|
| };
|
|
|
| -#endif // CONTENT_RENDERER_GPU_RENDERER_GL_CONTEXT_H_
|
| +#endif // CONTENT_COMMON_GPU_CLIENT_RENDERER_GL_CONTEXT_H_
|
|
|