gfx/angle/src/libGLESv2/renderer/TextureStorage.cpp

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 #include "precompiled.h"
michael@0 2 //
michael@0 3 // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
michael@0 4 // Use of this source code is governed by a BSD-style license that can be
michael@0 5 // found in the LICENSE file.
michael@0 6 //
michael@0 7
michael@0 8 // TextureStorage.cpp: Implements the abstract rx::TextureStorageInterface class and its concrete derived
michael@0 9 // classes TextureStorageInterface2D and TextureStorageInterfaceCube, which act as the interface to the
michael@0 10 // GPU-side texture.
michael@0 11
michael@0 12 #include "libGLESv2/renderer/TextureStorage.h"
michael@0 13 #include "libGLESv2/renderer/Renderer.h"
michael@0 14 #include "libGLESv2/Renderbuffer.h"
michael@0 15 #include "libGLESv2/Texture.h"
michael@0 16
michael@0 17 #include "common/debug.h"
michael@0 18
michael@0 19 namespace rx
michael@0 20 {
michael@0 21 unsigned int TextureStorageInterface::mCurrentTextureSerial = 1;
michael@0 22
michael@0 23 TextureStorageInterface::TextureStorageInterface()
michael@0 24 : mTextureSerial(issueTextureSerial()),
michael@0 25 mInstance(NULL)
michael@0 26 {
michael@0 27 }
michael@0 28
michael@0 29 TextureStorageInterface::~TextureStorageInterface()
michael@0 30 {
michael@0 31 delete mInstance;
michael@0 32 }
michael@0 33
michael@0 34 bool TextureStorageInterface::isRenderTarget() const
michael@0 35 {
michael@0 36 return mInstance->isRenderTarget();
michael@0 37 }
michael@0 38
michael@0 39
michael@0 40 bool TextureStorageInterface::isManaged() const
michael@0 41 {
michael@0 42 return mInstance->isManaged();
michael@0 43 }
michael@0 44
michael@0 45 unsigned int TextureStorageInterface::getTextureSerial() const
michael@0 46 {
michael@0 47 return mTextureSerial;
michael@0 48 }
michael@0 49
michael@0 50 unsigned int TextureStorageInterface::issueTextureSerial()
michael@0 51 {
michael@0 52 return mCurrentTextureSerial++;
michael@0 53 }
michael@0 54
michael@0 55 int TextureStorageInterface::getLodOffset() const
michael@0 56 {
michael@0 57 return mInstance->getLodOffset();
michael@0 58 }
michael@0 59
michael@0 60
michael@0 61 int TextureStorageInterface::levelCount()
michael@0 62 {
michael@0 63 return mInstance->levelCount();
michael@0 64 }
michael@0 65
michael@0 66 TextureStorageInterface2D::TextureStorageInterface2D(Renderer *renderer, SwapChain *swapchain)
michael@0 67 : mRenderTargetSerial(gl::RenderbufferStorage::issueSerial())
michael@0 68 {
michael@0 69 mInstance = renderer->createTextureStorage2D(swapchain);
michael@0 70 }
michael@0 71
michael@0 72 TextureStorageInterface2D::TextureStorageInterface2D(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, GLsizei width, GLsizei height)
michael@0 73 : mRenderTargetSerial(gl::RenderbufferStorage::issueSerial())
michael@0 74 {
michael@0 75 mInstance = renderer->createTextureStorage2D(levels, internalformat, usage, forceRenderable, width, height);
michael@0 76 }
michael@0 77
michael@0 78 TextureStorageInterface2D::~TextureStorageInterface2D()
michael@0 79 {
michael@0 80 }
michael@0 81
michael@0 82 RenderTarget *TextureStorageInterface2D::getRenderTarget() const
michael@0 83 {
michael@0 84 return mInstance->getRenderTarget();
michael@0 85 }
michael@0 86
michael@0 87 void TextureStorageInterface2D::generateMipmap(int level)
michael@0 88 {
michael@0 89 mInstance->generateMipmap(level);
michael@0 90 }
michael@0 91
michael@0 92 unsigned int TextureStorageInterface2D::getRenderTargetSerial(GLenum target) const
michael@0 93 {
michael@0 94 return mRenderTargetSerial;
michael@0 95 }
michael@0 96
michael@0 97 TextureStorageInterfaceCube::TextureStorageInterfaceCube(Renderer *renderer, int levels, GLenum internalformat, GLenum usage, bool forceRenderable, int size)
michael@0 98 : mFirstRenderTargetSerial(gl::RenderbufferStorage::issueCubeSerials())
michael@0 99 {
michael@0 100 mInstance = renderer->createTextureStorageCube(levels, internalformat, usage, forceRenderable, size);
michael@0 101 }
michael@0 102
michael@0 103 TextureStorageInterfaceCube::~TextureStorageInterfaceCube()
michael@0 104 {
michael@0 105 }
michael@0 106
michael@0 107 RenderTarget *TextureStorageInterfaceCube::getRenderTarget(GLenum faceTarget) const
michael@0 108 {
michael@0 109 return mInstance->getRenderTarget(faceTarget);
michael@0 110 }
michael@0 111
michael@0 112 void TextureStorageInterfaceCube::generateMipmap(int face, int level)
michael@0 113 {
michael@0 114 mInstance->generateMipmap(face, level);
michael@0 115 }
michael@0 116
michael@0 117 unsigned int TextureStorageInterfaceCube::getRenderTargetSerial(GLenum target) const
michael@0 118 {
michael@0 119 return mFirstRenderTargetSerial + gl::TextureCubeMap::faceIndex(target);
michael@0 120 }
michael@0 121
michael@0 122 }

mercurial