gfx/angle/src/libGLESv2/renderer/Image.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 //
michael@0 2 // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
michael@0 3 // Use of this source code is governed by a BSD-style license that can be
michael@0 4 // found in the LICENSE file.
michael@0 5 //
michael@0 6
michael@0 7 // Image.h: Defines the rx::Image class, an abstract base class for the
michael@0 8 // renderer-specific classes which will define the interface to the underlying
michael@0 9 // surfaces or resources.
michael@0 10
michael@0 11 #ifndef LIBGLESV2_RENDERER_IMAGE_H_
michael@0 12 #define LIBGLESV2_RENDERER_IMAGE_H_
michael@0 13
michael@0 14 #include "common/debug.h"
michael@0 15
michael@0 16 namespace gl
michael@0 17 {
michael@0 18 class Framebuffer;
michael@0 19 }
michael@0 20
michael@0 21 namespace rx
michael@0 22 {
michael@0 23 class Renderer;
michael@0 24 class TextureStorageInterface2D;
michael@0 25 class TextureStorageInterfaceCube;
michael@0 26
michael@0 27 class Image
michael@0 28 {
michael@0 29 public:
michael@0 30 Image();
michael@0 31 virtual ~Image() {};
michael@0 32
michael@0 33 GLsizei getWidth() const { return mWidth; }
michael@0 34 GLsizei getHeight() const { return mHeight; }
michael@0 35 GLenum getInternalFormat() const { return mInternalFormat; }
michael@0 36 GLenum getActualFormat() const { return mActualFormat; }
michael@0 37
michael@0 38 void markDirty() {mDirty = true;}
michael@0 39 void markClean() {mDirty = false;}
michael@0 40 virtual bool isDirty() const = 0;
michael@0 41
michael@0 42 virtual void setManagedSurface(TextureStorageInterface2D *storage, int level) {};
michael@0 43 virtual void setManagedSurface(TextureStorageInterfaceCube *storage, int face, int level) {};
michael@0 44 virtual bool updateSurface(TextureStorageInterface2D *storage, int level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height) = 0;
michael@0 45 virtual bool updateSurface(TextureStorageInterfaceCube *storage, int face, int level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height) = 0;
michael@0 46
michael@0 47 virtual bool redefine(Renderer *renderer, GLint internalformat, GLsizei width, GLsizei height, bool forceRelease) = 0;
michael@0 48
michael@0 49 virtual bool isRenderableFormat() const = 0;
michael@0 50
michael@0 51 virtual void loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
michael@0 52 GLint unpackAlignment, const void *input) = 0;
michael@0 53 virtual void loadCompressedData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
michael@0 54 const void *input) = 0;
michael@0 55
michael@0 56 virtual void copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, gl::Framebuffer *source) = 0;
michael@0 57
michael@0 58 static void loadAlphaDataToBGRA(GLsizei width, GLsizei height,
michael@0 59 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 60 static void loadAlphaDataToNative(GLsizei width, GLsizei height,
michael@0 61 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 62 static void loadAlphaDataToBGRASSE2(GLsizei width, GLsizei height,
michael@0 63 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 64 static void loadAlphaFloatDataToRGBA(GLsizei width, GLsizei height,
michael@0 65 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 66 static void loadAlphaHalfFloatDataToRGBA(GLsizei width, GLsizei height,
michael@0 67 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 68 static void loadLuminanceDataToNativeOrBGRA(GLsizei width, GLsizei height,
michael@0 69 int inputPitch, const void *input, size_t outputPitch, void *output, bool native);
michael@0 70 static void loadLuminanceFloatDataToRGBA(GLsizei width, GLsizei height,
michael@0 71 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 72 static void loadLuminanceFloatDataToRGB(GLsizei width, GLsizei height,
michael@0 73 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 74 static void loadLuminanceHalfFloatDataToRGBA(GLsizei width, GLsizei height,
michael@0 75 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 76 static void loadLuminanceAlphaDataToNativeOrBGRA(GLsizei width, GLsizei height,
michael@0 77 int inputPitch, const void *input, size_t outputPitch, void *output, bool native);
michael@0 78 static void loadLuminanceAlphaFloatDataToRGBA(GLsizei width, GLsizei height,
michael@0 79 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 80 static void loadLuminanceAlphaHalfFloatDataToRGBA(GLsizei width, GLsizei height,
michael@0 81 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 82 static void loadRGBUByteDataToBGRX(GLsizei width, GLsizei height,
michael@0 83 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 84 static void loadRGBUByteDataToRGBA(GLsizei width, GLsizei height,
michael@0 85 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 86 static void loadRGB565DataToBGRA(GLsizei width, GLsizei height,
michael@0 87 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 88 static void loadRGB565DataToRGBA(GLsizei width, GLsizei height,
michael@0 89 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 90 static void loadRGBFloatDataToRGBA(GLsizei width, GLsizei height,
michael@0 91 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 92 static void loadRGBFloatDataToNative(GLsizei width, GLsizei height,
michael@0 93 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 94 static void loadRGBHalfFloatDataToRGBA(GLsizei width, GLsizei height,
michael@0 95 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 96 static void loadRGBAUByteDataToBGRASSE2(GLsizei width, GLsizei height,
michael@0 97 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 98 static void loadRGBAUByteDataToBGRA(GLsizei width, GLsizei height,
michael@0 99 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 100 static void loadRGBAUByteDataToNative(GLsizei width, GLsizei height,
michael@0 101 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 102 static void loadRGBA4444DataToBGRA(GLsizei width, GLsizei height,
michael@0 103 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 104 static void loadRGBA4444DataToRGBA(GLsizei width, GLsizei height,
michael@0 105 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 106 static void loadRGBA5551DataToBGRA(GLsizei width, GLsizei height,
michael@0 107 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 108 static void loadRGBA5551DataToRGBA(GLsizei width, GLsizei height,
michael@0 109 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 110 static void loadRGBAFloatDataToRGBA(GLsizei width, GLsizei height,
michael@0 111 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 112 static void loadRGBAHalfFloatDataToRGBA(GLsizei width, GLsizei height,
michael@0 113 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 114 static void loadBGRADataToBGRA(GLsizei width, GLsizei height,
michael@0 115 int inputPitch, const void *input, size_t outputPitch, void *output);
michael@0 116
michael@0 117 protected:
michael@0 118 GLsizei mWidth;
michael@0 119 GLsizei mHeight;
michael@0 120 GLint mInternalFormat;
michael@0 121 GLenum mActualFormat;
michael@0 122
michael@0 123 bool mDirty;
michael@0 124
michael@0 125 private:
michael@0 126 DISALLOW_COPY_AND_ASSIGN(Image);
michael@0 127 };
michael@0 128
michael@0 129 }
michael@0 130
michael@0 131 #endif // LIBGLESV2_RENDERER_IMAGE_H_

mercurial