Chromium Code Reviews| Index: gpu/command_buffer/service/display.h |
| =================================================================== |
| --- gpu/command_buffer/service/display.h (revision 0) |
| +++ gpu/command_buffer/service/display.h (revision 0) |
| @@ -0,0 +1,79 @@ |
| +// Copyright (c) 2012 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 GPU_COMMAND_BUFFER_SERVICE_DISPLAY_H_ |
| +#define GPU_COMMAND_BUFFER_SERVICE_DISPLAY_H_ |
| + |
| +#include <queue> |
| + |
| +#include "base/hash_tables.h" |
| +#include "base/memory/linked_ptr.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "gpu/command_buffer/service/gl_utils.h" |
| +#include "gpu/gpu_export.h" |
| + |
| +namespace gpu { |
| +namespace gles2 { |
| + |
| +class TextureDefinition; |
| +class TextureManager; |
| + |
| +struct MailboxName { |
| + int32 components[32]; |
| +}; |
| + |
| +class GPU_EXPORT Display : public base::RefCounted<Display> { |
|
Ken Russell (switch to Gerrit)
2012/04/23 20:12:00
Is "Display" the best name? Maybe something more c
|
| + public: |
| + Display(); |
| + |
| + TextureDefinition* ConsumeTexture(GLenum target, const MailboxName& name); |
| + |
| + void ProduceTexture(GLenum target, |
| + const MailboxName& name, |
| + TextureDefinition* definition, |
| + TextureManager* owner); |
| + |
| + void DestroyOwnedTextures(TextureManager* owner, bool have_context); |
| + |
| + private: |
| + friend class base::RefCounted<Display>; |
| + |
| + struct TargetName { |
| + TargetName(GLenum target, const MailboxName& name); |
| + GLenum target; |
| + MailboxName name; |
| + }; |
| + |
| + struct TargetNameCompare { |
| + enum { |
| + bucket_size = 4, |
| + min_buckets = 8 |
| + }; |
| + size_t operator() (const TargetName& key) const; |
| + int operator() (const TargetName& lhs, const TargetName& rhs) const; |
| + }; |
| + |
| + struct OwnedTextureDefinition { |
| + OwnedTextureDefinition(TextureDefinition* definition, |
| + TextureManager* owner); |
| + linked_ptr<TextureDefinition> definition; |
| + TextureManager* owner; |
| + }; |
| + |
| + typedef base::hash_map<TargetName, OwnedTextureDefinition, TargetNameCompare> |
| + TextureDefinitionMap; |
| + |
| + ~Display(); |
| + |
| + TextureDefinitionMap textures_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(Display); |
| +}; |
| + |
| +} // namespage gles2 |
| +} // namespace gpu |
| + |
| +#endif // GPU_COMMAND_BUFFER_SERVICE_DISPLAY_H_ |
| + |
| + |
| Property changes on: gpu\command_buffer\service\display.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |