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

Side by Side Diff: cc/test/test_in_process_context_provider.cc

Issue 1131723002: Add ContextProvider::InvalidateGrContext to reset GL state in GrContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix int/uint typo Created 5 years, 7 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "cc/test/test_in_process_context_provider.h" 5 #include "cc/test/test_in_process_context_provider.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "gpu/GLES2/gl2extchromium.h" 8 #include "gpu/GLES2/gl2extchromium.h"
9 #include "gpu/command_buffer/client/gl_in_process_context.h" 9 #include "gpu/command_buffer/client/gl_in_process_context.h"
10 #include "gpu/command_buffer/client/gles2_implementation.h" 10 #include "gpu/command_buffer/client/gles2_implementation.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 skia::AdoptRef(skia_bindings::CreateCommandBufferSkiaGLBinding()); 117 skia::AdoptRef(skia_bindings::CreateCommandBufferSkiaGLBinding());
118 interface->fCallback = BindGrContextCallback; 118 interface->fCallback = BindGrContextCallback;
119 interface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(this); 119 interface->fCallbackData = reinterpret_cast<GrGLInterfaceCallbackData>(this);
120 120
121 gr_context_ = skia::AdoptRef(GrContext::Create( 121 gr_context_ = skia::AdoptRef(GrContext::Create(
122 kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(interface.get()))); 122 kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(interface.get())));
123 123
124 return gr_context_.get(); 124 return gr_context_.get();
125 } 125 }
126 126
127 void TestInProcessContextProvider::InvalidateGrContext(uint32_t state) {
128 if (gr_context_)
129 gr_context_.get()->resetContext(state);
130 }
131
127 void TestInProcessContextProvider::SetupLock() { 132 void TestInProcessContextProvider::SetupLock() {
128 } 133 }
129 134
130 base::Lock* TestInProcessContextProvider::GetLock() { 135 base::Lock* TestInProcessContextProvider::GetLock() {
131 return &context_lock_; 136 return &context_lock_;
132 } 137 }
133 138
134 ContextProvider::Capabilities 139 ContextProvider::Capabilities
135 TestInProcessContextProvider::ContextCapabilities() { 140 TestInProcessContextProvider::ContextCapabilities() {
136 ContextProvider::Capabilities capabilities; 141 ContextProvider::Capabilities capabilities;
(...skipping 14 matching lines...) Expand all
151 156
152 bool TestInProcessContextProvider::DestroyedOnMainThread() { return false; } 157 bool TestInProcessContextProvider::DestroyedOnMainThread() { return false; }
153 158
154 void TestInProcessContextProvider::SetLostContextCallback( 159 void TestInProcessContextProvider::SetLostContextCallback(
155 const LostContextCallback& lost_context_callback) {} 160 const LostContextCallback& lost_context_callback) {}
156 161
157 void TestInProcessContextProvider::SetMemoryPolicyChangedCallback( 162 void TestInProcessContextProvider::SetMemoryPolicyChangedCallback(
158 const MemoryPolicyChangedCallback& memory_policy_changed_callback) {} 163 const MemoryPolicyChangedCallback& memory_policy_changed_callback) {}
159 164
160 } // namespace cc 165 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698