/src/mozilla-central/gfx/webrender_bindings/RenderTextureHost.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #include "RenderTextureHost.h" |
8 | | #include "RenderThread.h" |
9 | | |
10 | | namespace mozilla { |
11 | | namespace wr { |
12 | | |
13 | | void |
14 | | ActivateBindAndTexParameteri(gl::GLContext* aGL, |
15 | | GLenum aActiveTexture, |
16 | | GLenum aBindTarget, |
17 | | GLuint aBindTexture, |
18 | | wr::ImageRendering aRendering) |
19 | 0 | { |
20 | 0 | aGL->fActiveTexture(aActiveTexture); |
21 | 0 | aGL->fBindTexture(aBindTarget, aBindTexture); |
22 | 0 | aGL->fTexParameteri(aBindTarget, |
23 | 0 | LOCAL_GL_TEXTURE_MIN_FILTER, |
24 | 0 | aRendering == wr::ImageRendering::Pixelated |
25 | 0 | ? LOCAL_GL_NEAREST |
26 | 0 | : LOCAL_GL_LINEAR); |
27 | 0 | aGL->fTexParameteri(aBindTarget, |
28 | 0 | LOCAL_GL_TEXTURE_MAG_FILTER, |
29 | 0 | aRendering == wr::ImageRendering::Pixelated |
30 | 0 | ? LOCAL_GL_NEAREST |
31 | 0 | : LOCAL_GL_LINEAR); |
32 | 0 | } |
33 | | |
34 | | RenderTextureHost::RenderTextureHost() |
35 | 0 | { |
36 | 0 | MOZ_COUNT_CTOR(RenderTextureHost); |
37 | 0 | } |
38 | | |
39 | | RenderTextureHost::~RenderTextureHost() |
40 | 0 | { |
41 | 0 | MOZ_ASSERT(RenderThread::IsInRenderThread()); |
42 | 0 | MOZ_COUNT_DTOR(RenderTextureHost); |
43 | 0 | } |
44 | | |
45 | | bool |
46 | | RenderTextureHost::IsFilterUpdateNecessary(wr::ImageRendering aRendering) |
47 | 0 | { |
48 | 0 | return mCachedRendering != aRendering; |
49 | 0 | } |
50 | | |
51 | | } // namespace wr |
52 | | } // namespace mozilla |