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

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

Issue 82553015: Switch the android overscroll glow to use UIResources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor naming changes Created 7 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 (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"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 virtual void SetSurface(jobject surface) OVERRIDE; 53 virtual void SetSurface(jobject surface) OVERRIDE;
54 virtual void SetVisible(bool visible) OVERRIDE; 54 virtual void SetVisible(bool visible) OVERRIDE;
55 virtual void setDeviceScaleFactor(float factor) OVERRIDE; 55 virtual void setDeviceScaleFactor(float factor) OVERRIDE;
56 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; 56 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE;
57 virtual bool CompositeAndReadback( 57 virtual bool CompositeAndReadback(
58 void *pixels, const gfx::Rect& rect) OVERRIDE; 58 void *pixels, const gfx::Rect& rect) OVERRIDE;
59 virtual void Composite() OVERRIDE; 59 virtual void Composite() OVERRIDE;
60 virtual cc::UIResourceId GenerateUIResource( 60 virtual cc::UIResourceId GenerateUIResource(
61 const cc::UIResourceBitmap& bitmap) OVERRIDE; 61 const cc::UIResourceBitmap& bitmap) OVERRIDE;
62 virtual void DeleteUIResource(cc::UIResourceId resource_id) OVERRIDE; 62 virtual void DeleteUIResource(cc::UIResourceId resource_id) OVERRIDE;
63 virtual gfx::Size GetUIResourceSize(cc::UIResourceId id) const OVERRIDE;
64
63 virtual blink::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) OVERRIDE; 65 virtual blink::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) OVERRIDE;
64 virtual blink::WebGLId GenerateCompressedTexture( 66 virtual blink::WebGLId GenerateCompressedTexture(
65 gfx::Size& size, int data_size, void* data) OVERRIDE; 67 gfx::Size& size, int data_size, void* data) OVERRIDE;
66 virtual void DeleteTexture(blink::WebGLId texture_id) OVERRIDE; 68 virtual void DeleteTexture(blink::WebGLId texture_id) OVERRIDE;
67 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, 69 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id,
68 gfx::JavaBitmap& bitmap) OVERRIDE; 70 gfx::JavaBitmap& bitmap) OVERRIDE;
69 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, 71 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id,
70 const gfx::Rect& sub_rect, 72 const gfx::Rect& sub_rect,
71 gfx::JavaBitmap& bitmap) OVERRIDE; 73 gfx::JavaBitmap& bitmap) OVERRIDE;
72 74
(...skipping 16 matching lines...) Expand all
89 91
90 // LayerTreeHostSingleThreadClient implementation. 92 // LayerTreeHostSingleThreadClient implementation.
91 virtual void ScheduleComposite() OVERRIDE; 93 virtual void ScheduleComposite() OVERRIDE;
92 virtual void ScheduleAnimation() OVERRIDE; 94 virtual void ScheduleAnimation() OVERRIDE;
93 virtual void DidPostSwapBuffers() OVERRIDE; 95 virtual void DidPostSwapBuffers() OVERRIDE;
94 virtual void DidAbortSwapBuffers() OVERRIDE; 96 virtual void DidAbortSwapBuffers() OVERRIDE;
95 97
96 // ImageTransportFactoryAndroidObserver implementation. 98 // ImageTransportFactoryAndroidObserver implementation.
97 virtual void OnLostResources() OVERRIDE; 99 virtual void OnLostResources() OVERRIDE;
98 100
101 virtual cc::UIResourceId GetOverscrollEdgeId() const OVERRIDE {
102 return overscroll_edge_id_;
103 }
104 virtual cc::UIResourceId GetOverscrollGlowId() const OVERRIDE {
105 return overscroll_glow_id_;
106 }
107
99 private: 108 private:
100 blink::WebGLId BuildBasicTexture(); 109 blink::WebGLId BuildBasicTexture();
101 blink::WGC3Denum GetGLFormatForBitmap(gfx::JavaBitmap& bitmap); 110 blink::WGC3Denum GetGLFormatForBitmap(gfx::JavaBitmap& bitmap);
102 blink::WGC3Denum GetGLTypeForBitmap(gfx::JavaBitmap& bitmap); 111 blink::WGC3Denum GetGLTypeForBitmap(gfx::JavaBitmap& bitmap);
103 112
113 void LoadOverscrollResources();
114
104 scoped_refptr<cc::Layer> root_layer_; 115 scoped_refptr<cc::Layer> root_layer_;
105 scoped_ptr<cc::LayerTreeHost> host_; 116 scoped_ptr<cc::LayerTreeHost> host_;
106 117
107 gfx::Size size_; 118 gfx::Size size_;
108 bool has_transparent_background_; 119 bool has_transparent_background_;
109 120
110 ANativeWindow* window_; 121 ANativeWindow* window_;
111 int surface_id_; 122 int surface_id_;
112 123
113 CompositorClient* client_; 124 CompositorClient* client_;
114 125
115 scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_; 126 scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_;
116 127
117 typedef base::ScopedPtrHashMap<cc::UIResourceId, cc::ScopedUIResource> 128 typedef base::ScopedPtrHashMap<cc::UIResourceId, cc::ScopedUIResource>
118 UIResourceMap; 129 UIResourceMap;
119 UIResourceMap ui_resource_map_; 130 UIResourceMap ui_resource_map_;
120 131
121 gfx::NativeWindow root_window_; 132 gfx::NativeWindow root_window_;
122 133
134 scoped_ptr<cc::UIResourceBitmap> overscroll_edge_bitmap_;
135 scoped_ptr<cc::UIResourceBitmap> overscroll_glow_bitmap_;
136 cc::UIResourceId overscroll_edge_id_;
137 cc::UIResourceId overscroll_glow_id_;
138
123 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); 139 DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
124 }; 140 };
125 141
126 } // namespace content 142 } // namespace content
127 143
128 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 144 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698