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

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: Created 6 years, 8 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 (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/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/containers/scoped_ptr_hash_map.h" 10 #include "base/containers/scoped_ptr_hash_map.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
12 #include "cc/resources/ui_resource_client.h" 13 #include "cc/resources/ui_resource_client.h"
13 #include "cc/trees/layer_tree_host_client.h" 14 #include "cc/trees/layer_tree_host_client.h"
14 #include "cc/trees/layer_tree_host_single_thread_client.h" 15 #include "cc/trees/layer_tree_host_single_thread_client.h"
15 #include "content/browser/renderer_host/image_transport_factory_android.h" 16 #include "content/browser/renderer_host/image_transport_factory_android.h"
16 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
17 #include "content/public/browser/android/compositor.h" 18 #include "content/public/browser/android/compositor.h"
18 #include "third_party/khronos/GLES2/gl2.h" 19 #include "third_party/khronos/GLES2/gl2.h"
19 #include "ui/base/android/window_android_compositor.h" 20 #include "ui/base/android/window_android_compositor.h"
20 21
21 class SkBitmap; 22 class SkBitmap;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // ImageTransportFactoryAndroidObserver implementation. 99 // ImageTransportFactoryAndroidObserver implementation.
99 virtual void OnLostResources() OVERRIDE; 100 virtual void OnLostResources() OVERRIDE;
100 101
101 // WindowAndroidCompositor implementation. 102 // WindowAndroidCompositor implementation.
102 virtual void AttachLayerForReadback(scoped_refptr<cc::Layer> layer) OVERRIDE; 103 virtual void AttachLayerForReadback(scoped_refptr<cc::Layer> layer) OVERRIDE;
103 104
104 private: 105 private:
105 cc::UIResourceId GenerateUIResourceFromUIResourceBitmap( 106 cc::UIResourceId GenerateUIResourceFromUIResourceBitmap(
106 const cc::UIResourceBitmap& bitmap, 107 const cc::UIResourceBitmap& bitmap,
107 bool is_transient); 108 bool is_transient);
109 void OnGpuChannelEstablished();
108 110
109 scoped_refptr<cc::Layer> root_layer_; 111 scoped_refptr<cc::Layer> root_layer_;
110 scoped_ptr<cc::LayerTreeHost> host_; 112 scoped_ptr<cc::LayerTreeHost> host_;
111 113
112 gfx::Size size_; 114 gfx::Size size_;
113 bool has_transparent_background_; 115 bool has_transparent_background_;
114 float device_scale_factor_; 116 float device_scale_factor_;
115 117
116 ANativeWindow* window_; 118 ANativeWindow* window_;
117 int surface_id_; 119 int surface_id_;
118 120
119 CompositorClient* client_; 121 CompositorClient* client_;
120 122
121 scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_; 123 scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_;
122 124
123 typedef base::ScopedPtrHashMap<cc::UIResourceId, cc::UIResourceClient> 125 typedef base::ScopedPtrHashMap<cc::UIResourceId, cc::UIResourceClient>
124 UIResourceMap; 126 UIResourceMap;
125 UIResourceMap ui_resource_map_; 127 UIResourceMap ui_resource_map_;
126 128
127 gfx::NativeWindow root_window_; 129 gfx::NativeWindow root_window_;
130 base::WeakPtrFactory<CompositorImpl> weak_factory_;
128 131
129 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); 132 DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
130 }; 133 };
131 134
132 } // namespace content 135 } // namespace content
133 136
134 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 137 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698