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

Unified Diff: gpu/command_buffer/service/texture_manager.h

Issue 1426903002: gpu: Make glTexSubImage2D work with GL_SRGB_ALPHA on OpenGL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove an unneeded hunk now that workarounds are used Created 5 years, 1 month 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: gpu/command_buffer/service/texture_manager.h
diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h
index ec0d548d950b183a005c672e63a99c157655b15e..85ad7e0a65f3acdecc7297137b96836fd37cfef7 100644
--- a/gpu/command_buffer/service/texture_manager.h
+++ b/gpu/command_buffer/service/texture_manager.h
@@ -868,6 +868,35 @@ class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider {
const char* function_name,
const DoTexImageArguments& args);
+ struct DoTexSubImageArguments {
+ GLenum target;
+ GLint level;
+ GLint xoffset;
+ GLint yoffset;
+ GLsizei width;
+ GLsizei height;
+ GLenum format;
+ GLenum type;
+ const void* pixels;
+ uint32 pixels_size;
+ // TODO(kkinnunen): currently this is used only for TexSubImage2D.
+ };
+
+ bool ValidateTexSubImage(
+ ContextState* state,
+ const char* function_name,
+ const DoTexSubImageArguments& args,
+ // Pointer to TextureRef filled in if validation successful.
+ // Presumes the pointer is valid.
+ TextureRef** texture_ref);
+
+ void ValidateAndDoTexSubImage(GLES2Decoder* decoder,
+ DecoderTextureState* texture_state,
+ ContextState* state,
+ DecoderFramebufferState* framebuffer_state,
+ const char* function_name,
+ const DoTexSubImageArguments& args);
+
// TODO(kloveless): Make GetTexture* private once this is no longer called
// from gles2_cmd_decoder.
TextureRef* GetTextureInfoForTarget(ContextState* state, GLenum target);
@@ -884,6 +913,14 @@ class GPU_EXPORT TextureManager : public base::trace_event::MemoryDumpProvider {
bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) override;
+ // Returns the union of |rect1| and |rect2| if one of the rectangles is empty,
+ // contains the other rectangle or shares an edge with the other rectangle.
+ // Part of the public interface because texture pixel data rectangle
+ // operations are also implemented in decoder at the moment.
+ static bool CombineAdjacentRects(const gfx::Rect& rect1,
+ const gfx::Rect& rect2,
+ gfx::Rect* result);
+
private:
friend class Texture;
friend class TextureRef;
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698