summaryrefslogtreecommitdiffstats
path: root/content/public/browser/android
diff options
context:
space:
mode:
Diffstat (limited to 'content/public/browser/android')
-rw-r--r--content/public/browser/android/synchronous_compositor.cc12
-rw-r--r--content/public/browser/android/synchronous_compositor.h14
2 files changed, 26 insertions, 0 deletions
diff --git a/content/public/browser/android/synchronous_compositor.cc b/content/public/browser/android/synchronous_compositor.cc
new file mode 100644
index 0000000..051aa5b
--- /dev/null
+++ b/content/public/browser/android/synchronous_compositor.cc
@@ -0,0 +1,12 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/browser/android/synchronous_compositor.h"
+
+namespace content {
+
+SynchronousCompositorMemoryPolicy::SynchronousCompositorMemoryPolicy()
+ : bytes_limit(0), num_resources_limit(0) {}
+
+} // namespace content
diff --git a/content/public/browser/android/synchronous_compositor.h b/content/public/browser/android/synchronous_compositor.h
index 810daf2..45b01eb 100644
--- a/content/public/browser/android/synchronous_compositor.h
+++ b/content/public/browser/android/synchronous_compositor.h
@@ -23,6 +23,16 @@ class WebContents;
class SynchronousCompositorClient;
+struct CONTENT_EXPORT SynchronousCompositorMemoryPolicy {
+ // Memory limit for rendering and pre-rendering.
+ size_t bytes_limit;
+
+ // Limit of number of GL resources used for rendering and pre-rendering.
+ size_t num_resources_limit;
+
+ SynchronousCompositorMemoryPolicy();
+};
+
// Interface for embedders that wish to direct compositing operations
// synchronously under their own control. Only meaningful when the
// kEnableSyncrhonousRendererCompositor flag is specified.
@@ -65,6 +75,10 @@ class CONTENT_EXPORT SynchronousCompositor {
// and clip set there-in).
virtual bool DemandDrawSw(SkCanvas* canvas) = 0;
+ // Set the memory limit policy of this compositor.
+ virtual void SetMemoryPolicy(
+ const SynchronousCompositorMemoryPolicy& policy) = 0;
+
// Should be called by the embedder after the embedder had modified the
// scroll offset of the root layer (as returned by
// SynchronousCompositorClient::GetTotalRootLayerScrollOffset).