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

Side by Side Diff: cc/output/in_process_context_provider.cc

Issue 2529703002: Mus: Install SwapBuffersCompleted/VSync callbacks to DirectOutputSurface(Ozone) (Closed)
Patch Set: Grab capabilities from the InProcessCommandBuffer instead of making them up 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
« no previous file with comments | « no previous file | gpu/ipc/gl_in_process_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/output/in_process_context_provider.h" 5 #include "cc/output/in_process_context_provider.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 void InProcessContextProvider::InvalidateGrContext(uint32_t state) { 114 void InProcessContextProvider::InvalidateGrContext(uint32_t state) {
115 if (gr_context_) 115 if (gr_context_)
116 gr_context_->ResetContext(state); 116 gr_context_->ResetContext(state);
117 } 117 }
118 118
119 base::Lock* InProcessContextProvider::GetLock() { 119 base::Lock* InProcessContextProvider::GetLock() {
120 return &context_lock_; 120 return &context_lock_;
121 } 121 }
122 122
123 gpu::Capabilities InProcessContextProvider::ContextCapabilities() { 123 gpu::Capabilities InProcessContextProvider::ContextCapabilities() {
124 gpu::Capabilities capabilities; 124 return context_->GetCapabilities();
125 capabilities.texture_rectangle = true;
126 capabilities.sync_query = true;
127 switch (PlatformColor::Format()) {
128 case PlatformColor::SOURCE_FORMAT_RGBA8:
129 capabilities.texture_format_bgra8888 = false;
130 break;
131 case PlatformColor::SOURCE_FORMAT_BGRA8:
132 capabilities.texture_format_bgra8888 = true;
133 break;
134 }
135 return capabilities;
136 } 125 }
137 126
138 void InProcessContextProvider::SetLostContextCallback( 127 void InProcessContextProvider::SetLostContextCallback(
139 const LostContextCallback& lost_context_callback) { 128 const LostContextCallback& lost_context_callback) {
140 // This code lives in the GPU process and so this would go away 129 // This code lives in the GPU process and so this would go away
141 // if the context is lost? 130 // if the context is lost?
142 } 131 }
143 132
144 uint32_t InProcessContextProvider::GetCopyTextureInternalFormat() { 133 uint32_t InProcessContextProvider::GetCopyTextureInternalFormat() {
145 if (attributes_.alpha_size > 0) 134 if (attributes_.alpha_size > 0)
(...skipping 10 matching lines...) Expand all
156 context_->SetSwapBuffersCompletionCallback(callback); 145 context_->SetSwapBuffersCompletionCallback(callback);
157 } 146 }
158 147
159 void InProcessContextProvider::SetUpdateVSyncParametersCallback( 148 void InProcessContextProvider::SetUpdateVSyncParametersCallback(
160 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& 149 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback&
161 callback) { 150 callback) {
162 context_->SetUpdateVSyncParametersCallback(callback); 151 context_->SetUpdateVSyncParametersCallback(callback);
163 } 152 }
164 153
165 } // namespace cc 154 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | gpu/ipc/gl_in_process_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698