diff options
author | reveman <reveman@chromium.org> | 2015-10-19 16:38:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-19 23:39:22 +0000 |
commit | 44429f23f3899d52c9493c114ae9b62e1ddeb7af (patch) | |
tree | e74bae28607a9c238eaf3e3ec2c4f1466f7d61e3 /ui/gl/gl_image.h | |
parent | ca96543ef138fe76457b5103bb02eebfde401387 (diff) | |
download | chromium_src-44429f23f3899d52c9493c114ae9b62e1ddeb7af.zip chromium_src-44429f23f3899d52c9493c114ae9b62e1ddeb7af.tar.gz chromium_src-44429f23f3899d52c9493c114ae9b62e1ddeb7af.tar.bz2 |
Revert of ui: Move GLImage::BindTexImage fallback from GLImage implementations to GLES2CmdDecoder. (patchset #15 id:280001 of https://codereview.chromium.org/1401423003/ )
Reason for revert:
Causing android gpu bots to fail
Original issue's description:
> ui: Move GLImage::BindTexImage fallback from GLImage implementations to GLES2CmdDecoder.
>
> This allows the GPU service to properly track the memory usage
> image backed textures.
>
> It also reduces the complexity of GLImage implementations
> significantly and makes it easier to support format and
> buffer types that require a copy or conversion of data to
> be used for sampling.
>
> This change also includes a few minor GLImage cleanups such
> as removing gfx:: namespace prefix in places where it's not
> needed and making the CopyTexImage GLImage test not part of
> the core GLImage tests as it's optional to support that
> function.
>
> BUG=526298
> TEST=gl_tests --gtest_filter=GpuMemoryBuffer*, gpu_unittests, gl_unittests --gtest_filter=GLImage*
>
> Committed: https://crrev.com/ac2696e324bda3824952148f831e76a8b80594b3
> Cr-Commit-Position: refs/heads/master@{#354870}
TBR=dcastagna@chromium.org,ericrk@chromium.org,fsamuel@chromium.org,liberato@chromium.org,sievers@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=526298
Review URL: https://codereview.chromium.org/1418483003
Cr-Commit-Position: refs/heads/master@{#354914}
Diffstat (limited to 'ui/gl/gl_image.h')
-rw-r--r-- | ui/gl/gl_image.h | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/ui/gl/gl_image.h b/ui/gl/gl_image.h index aba2651..a236699 100644 --- a/ui/gl/gl_image.h +++ b/ui/gl/gl_image.h @@ -5,8 +5,6 @@ #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" @@ -24,8 +22,8 @@ class ProcessMemoryDump; namespace gfx { -// Encapsulates an image that can be bound and/or copied to a texture, hiding -// platform specific management. +// Encapsulates an image that can be bound to a texture, hiding platform +// specific management. class GL_EXPORT GLImage : public base::RefCounted<GLImage> { public: GLImage() {} @@ -34,32 +32,36 @@ class GL_EXPORT GLImage : public base::RefCounted<GLImage> { virtual void Destroy(bool have_context) = 0; // Get the size of the image. - virtual Size GetSize() = 0; + virtual gfx::Size GetSize() = 0; // Get the internal format of the image. virtual unsigned GetInternalFormat() = 0; - // Bind image to texture currently bound to |target|. Returns true on success. - // It is valid for an implementation to always return false. + // Bind image to texture currently bound to |target|. 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(AcceleratedWidget widget, + virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, int z_order, OverlayTransform transform, const Rect& bounds_rect, |