Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: cc/output/context_provider.h

Issue 87903002: Modified the structure ContextProvider::Capabilities to use bitfields. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_OUTPUT_CONTEXT_PROVIDER_H_ 5 #ifndef CC_OUTPUT_CONTEXT_PROVIDER_H_
6 #define CC_OUTPUT_CONTEXT_PROVIDER_H_ 6 #define CC_OUTPUT_CONTEXT_PROVIDER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "cc/base/cc_export.h" 10 #include "cc/base/cc_export.h"
(...skipping 11 matching lines...) Expand all
22 // accessing the contexts. Calling it more than once should have no effect. 22 // accessing the contexts. Calling it more than once should have no effect.
23 // Once this function has been called, the class should only be accessed 23 // Once this function has been called, the class should only be accessed
24 // from the same thread. 24 // from the same thread.
25 virtual bool BindToCurrentThread() = 0; 25 virtual bool BindToCurrentThread() = 0;
26 26
27 virtual blink::WebGraphicsContext3D* Context3d() = 0; 27 virtual blink::WebGraphicsContext3D* Context3d() = 0;
28 virtual gpu::ContextSupport* ContextSupport() = 0; 28 virtual gpu::ContextSupport* ContextSupport() = 0;
29 virtual class GrContext* GrContext() = 0; 29 virtual class GrContext* GrContext() = 0;
30 30
31 struct Capabilities { 31 struct Capabilities {
32 bool discard_backbuffer; 32 bool discard_backbuffer : 1;
33 bool egl_image_external; 33 bool egl_image_external : 1;
34 bool fast_npot_mo8_textures; 34 bool fast_npot_mo8_textures : 1;
35 bool iosurface; 35 bool iosurface : 1;
36 bool map_image; 36 bool map_image : 1;
37 bool map_sub; 37 bool map_sub : 1;
38 bool post_sub_buffer; 38 bool post_sub_buffer : 1;
39 bool set_visibility; 39 bool set_visibility : 1;
40 bool shallow_flush; 40 bool shallow_flush : 1;
41 bool swapbuffers_complete_callback; 41 bool swapbuffers_complete_callback : 1;
42 bool texture_format_bgra8888; 42 bool texture_format_bgra8888 : 1;
43 bool texture_format_etc1; 43 bool texture_format_etc1 : 1;
44 bool texture_rectangle; 44 bool texture_rectangle : 1;
45 bool texture_storage; 45 bool texture_storage : 1;
46 bool texture_usage; 46 bool texture_usage : 1;
47 bool discard_framebuffer; 47 bool discard_framebuffer : 1;
48 size_t max_transfer_buffer_usage_bytes; 48 size_t max_transfer_buffer_usage_bytes;
49 49
50 CC_EXPORT Capabilities(); 50 CC_EXPORT Capabilities();
51 }; 51 };
52 // Returns the capabilities of the currently bound 3d context. 52 // Returns the capabilities of the currently bound 3d context.
53 virtual Capabilities ContextCapabilities() = 0; 53 virtual Capabilities ContextCapabilities() = 0;
54 54
55 // Checks if the context is currently known to be lost. 55 // Checks if the context is currently known to be lost.
56 virtual bool IsContextLost() = 0; 56 virtual bool IsContextLost() = 0;
57 57
(...skipping 28 matching lines...) Expand all
86 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; 86 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0;
87 87
88 protected: 88 protected:
89 friend class base::RefCountedThreadSafe<ContextProvider>; 89 friend class base::RefCountedThreadSafe<ContextProvider>;
90 virtual ~ContextProvider() {} 90 virtual ~ContextProvider() {}
91 }; 91 };
92 92
93 } // namespace cc 93 } // namespace cc
94 94
95 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ 95 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698