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

Unified Diff: android_webview/browser/shared_renderer_state.cc

Issue 266353003: aw: Ubercomp mega patch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/browser/shared_renderer_state.h ('k') | android_webview/common/aw_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/shared_renderer_state.cc
diff --git a/android_webview/browser/shared_renderer_state.cc b/android_webview/browser/shared_renderer_state.cc
index 3483d630e7cb1eafbc02f812d0998902487aae1c..33c115a7bc90371678f3a9ad26700946103056cf 100644
--- a/android_webview/browser/shared_renderer_state.cc
+++ b/android_webview/browser/shared_renderer_state.cc
@@ -12,8 +12,12 @@ namespace android_webview {
DrawGLInput::DrawGLInput() : frame_id(0), width(0), height(0) {}
+DrawGLInput::~DrawGLInput() {}
+
DrawGLResult::DrawGLResult() : frame_id(0), clip_contains_visible_rect(false) {}
+DrawGLResult::~DrawGLResult() {}
+
SharedRendererState::SharedRendererState(
scoped_refptr<base::MessageLoopProxy> ui_loop,
BrowserViewRendererClient* client)
@@ -76,14 +80,16 @@ SharedRendererState::GetMemoryPolicy() const {
return memory_policy_;
}
-void SharedRendererState::SetDrawGLInput(const DrawGLInput& input) {
+scoped_ptr<DrawGLInput> SharedRendererState::SetDrawGLInput(scoped_ptr<DrawGLInput> input) {
base::AutoLock lock(lock_);
- draw_gl_input_ = input;
+ scoped_ptr<DrawGLInput> old_input = draw_gl_input_.Pass();
+ draw_gl_input_ = input.Pass();
+ return old_input.Pass();
}
-DrawGLInput SharedRendererState::GetDrawGLInput() const {
+scoped_ptr<DrawGLInput> SharedRendererState::PassDrawGLInput() {
base::AutoLock lock(lock_);
- return draw_gl_input_;
+ return draw_gl_input_.Pass();
}
void SharedRendererState::ClearClosureQueue() {
@@ -129,4 +135,28 @@ bool SharedRendererState::IsMemoryPolicyDirty() const {
return memory_policy_dirty_;
}
+void SharedRendererState::ReturnResources(
+ const cc::TransferableResourceArray& input) {
+ base::AutoLock lock(lock_);
+ cc::TransferableResource::ReturnResources(input, &returned_resources_);
+}
+
+void SharedRendererState::InsertReturnedResources(
+ const cc::ReturnedResourceArray& resources) {
+ base::AutoLock lock(lock_);
+ returned_resources_.insert(
+ returned_resources_.end(), resources.begin(), resources.end());
+}
+
+void SharedRendererState::SwapReturnedResources(
+ cc::ReturnedResourceArray* resources) {
+ base::AutoLock lock(lock_);
+ resources->swap(returned_resources_);
+}
+
+bool SharedRendererState::ReturnedResourcesEmpty() const {
+ base::AutoLock lock(lock_);
+ return returned_resources_.empty();
+}
+
} // namespace android_webview
« no previous file with comments | « android_webview/browser/shared_renderer_state.h ('k') | android_webview/common/aw_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698