summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
diff options
context:
space:
mode:
authorkaanb@chromium.org <kaanb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-16 04:33:16 +0000
committerkaanb@chromium.org <kaanb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-16 04:33:16 +0000
commit5baa86bcc297c2a82bd7a54d7b58406684daf07c (patch)
treebd79c54b8d4c57134be1a71cdd21f16024bc7591 /gpu/command_buffer/service/gles2_cmd_decoder_mock.h
parentf2c8999c560c273eeee75f7b7da9ff812e23ccfe (diff)
downloadchromium_src-5baa86bcc297c2a82bd7a54d7b58406684daf07c.zip
chromium_src-5baa86bcc297c2a82bd7a54d7b58406684daf07c.tar.gz
chromium_src-5baa86bcc297c2a82bd7a54d7b58406684daf07c.tar.bz2
During virtual context switches only restore texture units
that have changed from the previous context. The most CPU consuming operations on the GPU thread for Android are virtual context switches. We attempt to reduce the CPU usage by context switches with this patch. BUG=244701 Review URL: https://codereview.chromium.org/118203002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/gles2_cmd_decoder_mock.h')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_mock.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
index edec2a0..a945caf 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
@@ -28,6 +28,7 @@ namespace gles2 {
class ContextGroup;
class ErrorState;
class QueryManager;
+struct ContextState;
class MockGLES2Decoder : public GLES2Decoder {
public:
@@ -51,13 +52,15 @@ class MockGLES2Decoder : public GLES2Decoder {
MOCK_METHOD0(GetGLSurface, gfx::GLSurface*());
MOCK_METHOD0(GetGLContext, gfx::GLContext*());
MOCK_METHOD0(GetContextGroup, ContextGroup*());
+ MOCK_METHOD0(GetContextState, const ContextState*());
MOCK_METHOD0(GetCapabilities, Capabilities());
MOCK_METHOD0(ProcessPendingQueries, bool());
MOCK_METHOD0(HasMoreIdleWork, bool());
MOCK_METHOD0(PerformIdleWork, void());
- MOCK_CONST_METHOD0(RestoreState, void());
+ MOCK_CONST_METHOD1(RestoreState, void(const ContextState* prev_state));
MOCK_CONST_METHOD0(RestoreActiveTexture, void());
- MOCK_CONST_METHOD0(RestoreAllTextureUnitBindings, void());
+ MOCK_CONST_METHOD1(
+ RestoreAllTextureUnitBindings, void(const ContextState* state));
MOCK_CONST_METHOD1(RestoreAttribute, void(unsigned index));
MOCK_CONST_METHOD0(RestoreBufferBindings, void());
MOCK_CONST_METHOD0(RestoreFramebufferBindings, void());