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

Side by Side Diff: android_webview/browser/hardware_renderer.cc

Issue 348093004: Make cc output surface creation async (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android compile fixes Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "android_webview/browser/hardware_renderer.h" 5 #include "android_webview/browser/hardware_renderer.h"
6 6
7 #include "android_webview/browser/aw_gl_surface.h" 7 #include "android_webview/browser/aw_gl_surface.h"
8 #include "android_webview/browser/deferred_gpu_command_service.h" 8 #include "android_webview/browser/deferred_gpu_command_service.h"
9 #include "android_webview/browser/parent_output_surface.h" 9 #include "android_webview/browser/parent_output_surface.h"
10 #include "android_webview/browser/shared_renderer_state.h" 10 #include "android_webview/browser/shared_renderer_state.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 gl_surface_->SetBackingFrameBufferObject(framebuffer_binding_ext); 238 gl_surface_->SetBackingFrameBufferObject(framebuffer_binding_ext);
239 { 239 {
240 base::AutoReset<bool> frame_resetter(&viewport_clip_valid_for_dcheck_, 240 base::AutoReset<bool> frame_resetter(&viewport_clip_valid_for_dcheck_,
241 true); 241 true);
242 layer_tree_host_->SetNeedsRedrawRect(clip_); 242 layer_tree_host_->SetNeedsRedrawRect(clip_);
243 layer_tree_host_->Composite(gfx::FrameTime::Now()); 243 layer_tree_host_->Composite(gfx::FrameTime::Now());
244 } 244 }
245 gl_surface_->ResetBackingFrameBufferObject(); 245 gl_surface_->ResetBackingFrameBufferObject();
246 } 246 }
247 247
248 scoped_ptr<cc::OutputSurface> HardwareRenderer::CreateOutputSurface( 248 void HardwareRenderer::RequestNewOutputSurface(bool fallback) {
249 bool fallback) {
250 // Android webview does not support losing output surface. 249 // Android webview does not support losing output surface.
251 DCHECK(!fallback); 250 DCHECK(!fallback);
252 scoped_refptr<cc::ContextProvider> context_provider = 251 scoped_refptr<cc::ContextProvider> context_provider =
253 CreateContext(gl_surface_, 252 CreateContext(gl_surface_,
254 DeferredGpuCommandService::GetInstance()); 253 DeferredGpuCommandService::GetInstance());
255 scoped_ptr<ParentOutputSurface> output_surface_holder( 254 scoped_ptr<ParentOutputSurface> output_surface_holder(
256 new ParentOutputSurface(context_provider)); 255 new ParentOutputSurface(context_provider));
257 output_surface_ = output_surface_holder.get(); 256 output_surface_ = output_surface_holder.get();
258 return output_surface_holder.PassAs<cc::OutputSurface>(); 257 layer_tree_host_->SetOutputSurface(
258 output_surface_holder.PassAs<cc::OutputSurface>());
259 } 259 }
260 260
261 void HardwareRenderer::UnusedResourcesAreAvailable() { 261 void HardwareRenderer::UnusedResourcesAreAvailable() {
262 cc::ReturnedResourceArray returned_resources; 262 cc::ReturnedResourceArray returned_resources;
263 resource_collection_->TakeUnusedResourcesForChildCompositor( 263 resource_collection_->TakeUnusedResourcesForChildCompositor(
264 &returned_resources); 264 &returned_resources);
265 shared_renderer_state_->InsertReturnedResources(returned_resources); 265 shared_renderer_state_->InsertReturnedResources(returned_resources);
266 } 266 }
267 267
268 } // namespace android_webview 268 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698