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

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

Issue 22870016: Update the nine patch layer to use UI resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compilation error fixes Created 7 years, 3 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
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/hash_tables.h"
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "cc/resources/ui_resource_client.h"
12 #include "cc/trees/layer_tree_host_client.h" 14 #include "cc/trees/layer_tree_host_client.h"
13 #include "content/browser/renderer_host/image_transport_factory_android.h" 15 #include "content/browser/renderer_host/image_transport_factory_android.h"
14 #include "content/common/content_export.h" 16 #include "content/common/content_export.h"
15 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 17 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
16 #include "content/public/browser/android/compositor.h" 18 #include "content/public/browser/android/compositor.h"
17 19
18 struct ANativeWindow; 20 struct ANativeWindow;
19 21
20 namespace cc { 22 namespace cc {
21 class InputHandlerClient; 23 class InputHandlerClient;
22 class Layer; 24 class Layer;
23 class LayerTreeHost; 25 class LayerTreeHost;
26 class ScopedUIResource;
24 } 27 }
25 28
26 namespace content { 29 namespace content {
27 class CompositorClient; 30 class CompositorClient;
28 class GraphicsContext; 31 class GraphicsContext;
29 32
30 // ----------------------------------------------------------------------------- 33 // -----------------------------------------------------------------------------
31 // Browser-side compositor that manages a tree of content and UI layers. 34 // Browser-side compositor that manages a tree of content and UI layers.
32 // ----------------------------------------------------------------------------- 35 // -----------------------------------------------------------------------------
33 class CONTENT_EXPORT CompositorImpl 36 class CONTENT_EXPORT CompositorImpl
(...skipping 19 matching lines...) Expand all
53 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; 56 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE;
54 virtual void SetSurface(jobject surface) OVERRIDE; 57 virtual void SetSurface(jobject surface) OVERRIDE;
55 virtual void SetVisible(bool visible) OVERRIDE; 58 virtual void SetVisible(bool visible) OVERRIDE;
56 virtual void setDeviceScaleFactor(float factor) OVERRIDE; 59 virtual void setDeviceScaleFactor(float factor) OVERRIDE;
57 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; 60 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE;
58 virtual void SetHasTransparentBackground(bool flag) OVERRIDE; 61 virtual void SetHasTransparentBackground(bool flag) OVERRIDE;
59 virtual bool CompositeAndReadback( 62 virtual bool CompositeAndReadback(
60 void *pixels, const gfx::Rect& rect) OVERRIDE; 63 void *pixels, const gfx::Rect& rect) OVERRIDE;
61 virtual void SetNeedsRedraw() OVERRIDE; 64 virtual void SetNeedsRedraw() OVERRIDE;
62 virtual void Composite() OVERRIDE; 65 virtual void Composite() OVERRIDE;
66 virtual cc::UIResourceId GenerateUIResource(
67 scoped_refptr<cc::UIResourceBitmap> bitmap) OVERRIDE;
68 virtual void DeleteUIResource(cc::UIResourceId resource_id) OVERRIDE;
63 virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) OVERRIDE; 69 virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) OVERRIDE;
64 virtual WebKit::WebGLId GenerateCompressedTexture( 70 virtual WebKit::WebGLId GenerateCompressedTexture(
65 gfx::Size& size, int data_size, void* data) OVERRIDE; 71 gfx::Size& size, int data_size, void* data) OVERRIDE;
66 virtual void DeleteTexture(WebKit::WebGLId texture_id) OVERRIDE; 72 virtual void DeleteTexture(WebKit::WebGLId texture_id) OVERRIDE;
67 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, 73 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id,
68 gfx::JavaBitmap& bitmap) OVERRIDE; 74 gfx::JavaBitmap& bitmap) OVERRIDE;
69 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, 75 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id,
70 const gfx::Rect& sub_rect, 76 const gfx::Rect& sub_rect,
71 gfx::JavaBitmap& bitmap) OVERRIDE; 77 gfx::JavaBitmap& bitmap) OVERRIDE;
72 78
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 bool has_transparent_background_; 116 bool has_transparent_background_;
111 117
112 ANativeWindow* window_; 118 ANativeWindow* window_;
113 int surface_id_; 119 int surface_id_;
114 120
115 CompositorClient* client_; 121 CompositorClient* client_;
116 base::WeakPtrFactory<CompositorImpl> weak_factory_; 122 base::WeakPtrFactory<CompositorImpl> weak_factory_;
117 123
118 scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_; 124 scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_;
119 125
126 typedef base::hash_map<cc::UIResourceId, cc::ScopedUIResource*>
danakj 2013/08/27 15:42:48 Can you use cc/base/scoped_ptr_hash_map for this?
powei 2013/08/27 22:39:28 Including scoped_ptr_hash_map violated a dep rule
danakj 2013/08/27 22:43:50 Oh, clever DEPS rules. We should move it, just no
127 UIResourceMap;
128 UIResourceMap ui_resource_map_;
129
120 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); 130 DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
121 }; 131 };
122 132
123 } // namespace content 133 } // namespace content
124 134
125 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 135 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698