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

Side by Side Diff: content/browser/compositor/surface_utils.cc

Issue 2563783002: ui + mus: Split ContextFactory into ContextFactory(Client) and ContextFactoryPrivate (Closed)
Patch Set: Restore mash 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/compositor/surface_utils.h" 5 #include "content/browser/compositor/surface_utils.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 } // namespace 158 } // namespace
159 159
160 namespace content { 160 namespace content {
161 161
162 cc::FrameSinkId AllocateFrameSinkId() { 162 cc::FrameSinkId AllocateFrameSinkId() {
163 #if defined(OS_ANDROID) 163 #if defined(OS_ANDROID)
164 return ContextProviderFactoryImpl::GetInstance()->AllocateFrameSinkId(); 164 return ContextProviderFactoryImpl::GetInstance()->AllocateFrameSinkId();
165 #else 165 #else
166 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); 166 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
167 return factory->GetContextFactory()->AllocateFrameSinkId(); 167 return factory->GetContextFactoryPrivate()->AllocateFrameSinkId();
168 #endif 168 #endif
169 } 169 }
170 170
171 cc::SurfaceManager* GetSurfaceManager() { 171 cc::SurfaceManager* GetSurfaceManager() {
172 #if defined(OS_ANDROID) 172 #if defined(OS_ANDROID)
173 return ContextProviderFactoryImpl::GetInstance()->GetSurfaceManager(); 173 return ContextProviderFactoryImpl::GetInstance()->GetSurfaceManager();
174 #else 174 #else
175 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); 175 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
176 if (factory == NULL) 176 if (factory == NULL)
177 return nullptr; 177 return nullptr;
178 return factory->GetContextFactory()->GetSurfaceManager(); 178 return factory->GetContextFactoryPrivate()->GetSurfaceManager();
179 #endif 179 #endif
180 } 180 }
181 181
182 void CopyFromCompositingSurfaceHasResult( 182 void CopyFromCompositingSurfaceHasResult(
183 const gfx::Size& dst_size_in_pixel, 183 const gfx::Size& dst_size_in_pixel,
184 const SkColorType color_type, 184 const SkColorType color_type,
185 const ReadbackRequestCallback& callback, 185 const ReadbackRequestCallback& callback,
186 std::unique_ptr<cc::CopyOutputResult> result) { 186 std::unique_ptr<cc::CopyOutputResult> result) {
187 if (result->IsEmpty() || result->size().IsEmpty()) { 187 if (result->IsEmpty() || result->size().IsEmpty()) {
188 callback.Run(SkBitmap(), READBACK_FAILED); 188 callback.Run(SkBitmap(), READBACK_FAILED);
(...skipping 13 matching lines...) Expand all
202 return; 202 return;
203 } 203 }
204 204
205 DCHECK(result->HasBitmap()); 205 DCHECK(result->HasBitmap());
206 // Software path 206 // Software path
207 PrepareBitmapCopyOutputResult(output_size_in_pixel, color_type, callback, 207 PrepareBitmapCopyOutputResult(output_size_in_pixel, color_type, callback,
208 std::move(result)); 208 std::move(result));
209 } 209 }
210 210
211 } // namespace content 211 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698