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

Side by Side Diff: gpu/command_buffer/client/client_context_state.h

Issue 2558933003: Cache GL's viewport on the GPU command buffer client side. (Closed)
Patch Set: fix Created 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file contains the ContextState class. 5 // This file contains the ContextState class.
6 6
7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_H_ 7 #ifndef GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_H_
8 #define GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_H_ 8 #define GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_H_
9 9
10 #include <GLES3/gl3.h> 10 #include <GLES3/gl3.h>
11 #include "gles2_impl_export.h" 11 #include "gles2_impl_export.h"
12 12
13 namespace gpu { 13 namespace gpu {
14 namespace gles2 { 14 namespace gles2 {
15 15
16 struct GLES2_IMPL_EXPORT ClientContextState { 16 struct GLES2_IMPL_EXPORT ClientContextState {
17 ClientContextState(); 17 ClientContextState();
18 ~ClientContextState(); 18 ~ClientContextState();
19 19
20 // Returns true if state was cached in which case 'enabled' will be set to the 20 // Returns true if state was cached in which case 'enabled' will be set to the
21 // current state. 21 // current state.
22 bool GetEnabled(GLenum cap, bool* enabled) const; 22 bool GetEnabled(GLenum cap, bool* enabled) const;
23 23
24 // Sets the state of a capability. 24 // Sets the state of a capability.
25 // Returns true if the capability is one that is cached. 25 // Returns true if the capability is one that is cached.
26 // 'changed' will be true if the state was different from 'enabled. 26 // 'changed' will be true if the state was different from 'enabled.
27 bool SetCapabilityState(GLenum cap, bool enabled, bool* changed); 27 bool SetCapabilityState(GLenum cap, bool enabled, bool* changed);
28 28
29 // Cache the user's valid viewport.
30 void SetViewport(GLint x, GLint y, GLsizei width, GLsizei height);
31
29 #include "gpu/command_buffer/client/client_context_state_autogen.h" 32 #include "gpu/command_buffer/client/client_context_state_autogen.h"
30 33
31 EnableFlags enable_flags; 34 EnableFlags enable_flags;
35
36 GLint viewport_x = 0;
37 GLint viewport_y = 0;
38 GLsizei viewport_width = 0;
39 GLsizei viewport_height = 0;
32 }; 40 };
33 41
34 } // namespace gles2 42 } // namespace gles2
35 } // namespace gpu 43 } // namespace gpu
36 44
37 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_H_ 45 #endif // GPU_COMMAND_BUFFER_CLIENT_CLIENT_CONTEXT_STATE_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/client/client_context_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698