| Index: ui/gl/dirty_texture_state.h
|
| diff --git a/ui/gl/dirty_texture_state.h b/ui/gl/dirty_texture_state.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a839142d6d670ab4afcfdd562b77e9eb9ff7d8a8
|
| --- /dev/null
|
| +++ b/ui/gl/dirty_texture_state.h
|
| @@ -0,0 +1,59 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef UI_GL_DIRTY_TEXTURE_STATE_H_
|
| +#define UI_GL_DIRTY_TEXTURE_STATE_H_
|
| +
|
| +#include <vector>
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "ui/gl/gl_bindings.h"
|
| +#include "ui/gl/gl_export.h"
|
| +
|
| +namespace gfx {
|
| +
|
| +struct DirtyTextureBindings {
|
| + bool binding_2d;
|
| + bool binding_cube_map;
|
| + bool binding_external_oes;
|
| + bool binding_rectangle_arb;
|
| + DirtyTextureBindings() : binding_2d(false),
|
| + binding_cube_map(false),
|
| + binding_external_oes(false),
|
| + binding_rectangle_arb(false) {
|
| + }
|
| +};
|
| +
|
| +class DirtyTextureState {
|
| + public:
|
| + DirtyTextureState();
|
| + ~DirtyTextureState();
|
| +
|
| + void UpdateMaxTextureUnit(GLenum texture_unit);
|
| + void AddBinding(GLuint current_unit, GLenum target);
|
| + void Clear();
|
| + int GetMaxTextureUnitIndex() const { return max_texture_unit_ - GL_TEXTURE0; }
|
| + bool IsBinding2DDirtyForUnit(GLuint unit) const {
|
| + return bindings_[unit].binding_2d;
|
| + }
|
| + bool IsBindingCubeMapDirtyForUnit(GLuint unit) const {
|
| + return bindings_[unit].binding_cube_map;
|
| + }
|
| + bool IsBindingExternalOesDirtyForUnit(GLuint unit) const {
|
| + return bindings_[unit].binding_external_oes;
|
| + }
|
| + bool IsBindingRectangleArbDirtyForUnit(GLuint unit) const {
|
| + return bindings_[unit].binding_rectangle_arb;
|
| + }
|
| +
|
| + private:
|
| + std::vector<DirtyTextureBindings> bindings_;
|
| + GLenum max_texture_unit_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(DirtyTextureState);
|
| +};
|
| +
|
| +} // namespace gfx
|
| +
|
| +#endif // UI_GL_DIRTY_TEXTURE_STATE_H_
|
|
|