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

Unified Diff: ui/gl/gl_image.h

Issue 1401423003: Re-land: ui: Move GLImage::BindTexImage fallback from GLImage implementations to GLES2CmdDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix stream texture issue Created 5 years, 2 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
« no previous file with comments | « ui/gl/BUILD.gn ('k') | ui/gl/gl_image_egl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image.h
diff --git a/ui/gl/gl_image.h b/ui/gl/gl_image.h
index a23669952a80b8de92eb1a508f9a3124ff2901e1..aba2651ee9d476b940ddd68ec92ea350cd5b5329 100644
--- a/ui/gl/gl_image.h
+++ b/ui/gl/gl_image.h
@@ -5,6 +5,8 @@
#ifndef UI_GL_GL_IMAGE_H_
#define UI_GL_GL_IMAGE_H_
+#include <string>
+
#include "base/memory/ref_counted.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
@@ -22,8 +24,8 @@ class ProcessMemoryDump;
namespace gfx {
-// Encapsulates an image that can be bound to a texture, hiding platform
-// specific management.
+// Encapsulates an image that can be bound and/or copied to a texture, hiding
+// platform specific management.
class GL_EXPORT GLImage : public base::RefCounted<GLImage> {
public:
GLImage() {}
@@ -32,36 +34,32 @@ class GL_EXPORT GLImage : public base::RefCounted<GLImage> {
virtual void Destroy(bool have_context) = 0;
// Get the size of the image.
- virtual gfx::Size GetSize() = 0;
+ virtual Size GetSize() = 0;
// Get the internal format of the image.
virtual unsigned GetInternalFormat() = 0;
- // Bind image to texture currently bound to |target|.
+ // Bind image to texture currently bound to |target|. Returns true on success.
+ // It is valid for an implementation to always return false.
virtual bool BindTexImage(unsigned target) = 0;
// Release image from texture currently bound to |target|.
virtual void ReleaseTexImage(unsigned target) = 0;
+ // Define texture currently bound to |target| by copying image into it.
+ // Returns true on success. It is valid for an implementation to always
+ // return false.
+ virtual bool CopyTexImage(unsigned target) = 0;
+
// Copy |rect| of image to |offset| in texture currently bound to |target|.
+ // Returns true on success. It is valid for an implementation to always
+ // return false.
virtual bool CopyTexSubImage(unsigned target,
const Point& offset,
const Rect& rect) = 0;
- // Called before the texture is used for drawing.
- virtual void WillUseTexImage() = 0;
-
- // Called after the texture has been used for drawing.
- virtual void DidUseTexImage() = 0;
-
- // Called before the texture image data will be modified.
- virtual void WillModifyTexImage() = 0;
-
- // Called after the texture image data has been modified.
- virtual void DidModifyTexImage() = 0;
-
// Schedule image as an overlay plane to be shown at swap time for |widget|.
- virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
+ virtual bool ScheduleOverlayPlane(AcceleratedWidget widget,
int z_order,
OverlayTransform transform,
const Rect& bounds_rect,
« no previous file with comments | « ui/gl/BUILD.gn ('k') | ui/gl/gl_image_egl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698