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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.h

Issue 228663008: Android: Avoid blocking UI thread for GPU channel creation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix abort swap buffers Created 6 years, 6 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
« no previous file with comments | « no previous file | content/browser/renderer_host/compositor_impl_android.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/cancelable_callback.h" 9 #include "base/cancelable_callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/containers/scoped_ptr_hash_map.h" 11 #include "base/containers/scoped_ptr_hash_map.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h"
13 #include "cc/resources/ui_resource_client.h" 14 #include "cc/resources/ui_resource_client.h"
14 #include "cc/trees/layer_tree_host_client.h" 15 #include "cc/trees/layer_tree_host_client.h"
15 #include "cc/trees/layer_tree_host_single_thread_client.h" 16 #include "cc/trees/layer_tree_host_single_thread_client.h"
16 #include "content/browser/renderer_host/image_transport_factory_android.h" 17 #include "content/browser/renderer_host/image_transport_factory_android.h"
17 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
18 #include "content/public/browser/android/compositor.h" 19 #include "content/public/browser/android/compositor.h"
19 #include "third_party/khronos/GLES2/gl2.h" 20 #include "third_party/khronos/GLES2/gl2.h"
20 #include "ui/base/android/window_android_compositor.h" 21 #include "ui/base/android/window_android_compositor.h"
21 22
22 class SkBitmap; 23 class SkBitmap;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 DCHECK(WillComposite()); 129 DCHECK(WillComposite());
129 if (WillCompositeThisFrame()) 130 if (WillCompositeThisFrame())
130 current_composite_task_->Cancel(); 131 current_composite_task_->Cancel();
131 current_composite_task_.reset(); 132 current_composite_task_.reset();
132 composite_on_vsync_trigger_ = DO_NOT_COMPOSITE; 133 composite_on_vsync_trigger_ = DO_NOT_COMPOSITE;
133 will_composite_immediately_ = false; 134 will_composite_immediately_ = false;
134 } 135 }
135 cc::UIResourceId GenerateUIResourceFromUIResourceBitmap( 136 cc::UIResourceId GenerateUIResourceFromUIResourceBitmap(
136 const cc::UIResourceBitmap& bitmap, 137 const cc::UIResourceBitmap& bitmap,
137 bool is_transient); 138 bool is_transient);
139 void OnGpuChannelEstablished();
138 140
139 scoped_refptr<cc::Layer> root_layer_; 141 scoped_refptr<cc::Layer> root_layer_;
140 scoped_ptr<cc::LayerTreeHost> host_; 142 scoped_ptr<cc::LayerTreeHost> host_;
141 143
142 gfx::Size size_; 144 gfx::Size size_;
143 bool has_transparent_background_; 145 bool has_transparent_background_;
144 float device_scale_factor_; 146 float device_scale_factor_;
145 147
146 ANativeWindow* window_; 148 ANativeWindow* window_;
147 int surface_id_; 149 int surface_id_;
(...skipping 29 matching lines...) Expand all
177 // The Composite operation scheduled for the current vsync interval. 179 // The Composite operation scheduled for the current vsync interval.
178 scoped_ptr<base::CancelableClosure> current_composite_task_; 180 scoped_ptr<base::CancelableClosure> current_composite_task_;
179 181
180 // The number of SwapBuffer calls that have not returned and ACK'd from 182 // The number of SwapBuffer calls that have not returned and ACK'd from
181 // the GPU thread. 183 // the GPU thread.
182 unsigned int pending_swapbuffers_; 184 unsigned int pending_swapbuffers_;
183 185
184 base::TimeDelta vsync_period_; 186 base::TimeDelta vsync_period_;
185 base::TimeTicks last_vsync_; 187 base::TimeTicks last_vsync_;
186 188
189 base::WeakPtrFactory<CompositorImpl> weak_factory_;
190
187 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); 191 DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
188 }; 192 };
189 193
190 } // namespace content 194 } // namespace content
191 195
192 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 196 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698