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

Side by Side Diff: content/public/browser/android/compositor.h

Issue 239963002: Android: Move scheduling logic to CompositorImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "cc/resources/ui_resource_bitmap.h" 9 #include "cc/resources/ui_resource_bitmap.h"
10 #include "cc/resources/ui_resource_client.h" 10 #include "cc/resources/ui_resource_client.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 virtual void SetSurface(jobject surface) = 0; 62 virtual void SetSurface(jobject surface) = 0;
63 63
64 // Tells the view tree to assume a transparent background when rendering. 64 // Tells the view tree to assume a transparent background when rendering.
65 virtual void SetHasTransparentBackground(bool flag) = 0; 65 virtual void SetHasTransparentBackground(bool flag) = 0;
66 66
67 // Attempts to composite and read back the result into the provided buffer. 67 // Attempts to composite and read back the result into the provided buffer.
68 // The buffer must be at least window width * height * 4 (RGBA) bytes large. 68 // The buffer must be at least window width * height * 4 (RGBA) bytes large.
69 // The buffer is not modified if false is returned. 69 // The buffer is not modified if false is returned.
70 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0; 70 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0;
71 71
72 // Composite immediately. Used in single-threaded mode. 72 // Request layout and draw. You only need to call this if you need to trigger
73 virtual void Composite() = 0; 73 // Composite *without* having modified the layer tree.
74 virtual void SetNeedsComposite() = 0;
74 75
75 // Generates a UIResource and returns a UIResourceId. |is_transient| 76 // Generates a UIResource and returns a UIResourceId. |is_transient|
76 // indicates whether or not to release the resource once the bitmap 77 // indicates whether or not to release the resource once the bitmap
77 // has been uploaded. May return 0. 78 // has been uploaded. May return 0.
78 virtual cc::UIResourceId GenerateUIResource(const SkBitmap& bitmap, 79 virtual cc::UIResourceId GenerateUIResource(const SkBitmap& bitmap,
79 bool is_transient) = 0; 80 bool is_transient) = 0;
80 81
81 // Generates an ETC1 compressed UIResource. See above for |is_transient|. 82 // Generates an ETC1 compressed UIResource. See above for |is_transient|.
82 // May return 0. 83 // May return 0.
83 virtual cc::UIResourceId GenerateCompressedUIResource(const gfx::Size& size, 84 virtual cc::UIResourceId GenerateCompressedUIResource(const gfx::Size& size,
84 void* pixels, 85 void* pixels,
85 bool is_transient) = 0; 86 bool is_transient) = 0;
86 87
87 // Deletes a UIResource. 88 // Deletes a UIResource.
88 virtual void DeleteUIResource(cc::UIResourceId resource_id) = 0; 89 virtual void DeleteUIResource(cc::UIResourceId resource_id) = 0;
89 90
90 protected: 91 protected:
91 Compositor() {} 92 Compositor() {}
92 }; 93 };
93 94
94 } // namespace content 95 } // namespace content
95 96
96 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ 97 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698