summaryrefslogtreecommitdiffstats
path: root/cc/trees
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-15 12:54:58 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-15 12:54:58 +0000
commit7a8bcd261255f843e14960ceac7ab8dd76cddbc5 (patch)
tree739b0c2426cef29ffc4cc31993f06e5ca2e956d5 /cc/trees
parentd23e725294e0421a2f5617a52ca8169b56aa470a (diff)
downloadchromium_src-7a8bcd261255f843e14960ceac7ab8dd76cddbc5.zip
chromium_src-7a8bcd261255f843e14960ceac7ab8dd76cddbc5.tar.gz
chromium_src-7a8bcd261255f843e14960ceac7ab8dd76cddbc5.tar.bz2
cc: Add RendererCapabilitiesImpl
Separate RendererCapabilities and RendererCapabilitiesImpl classes to separate out capabilities that are not needed on main thread to be not copied to main thread. This is to prepare for the future when main and impl RendererCapabilities copies can temporarily get out of sync, and there are less values to worry about. BUG=332616 Review URL: https://codereview.chromium.org/133063003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244870 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees')
-rw-r--r--cc/trees/layer_tree_host.cc18
-rw-r--r--cc/trees/layer_tree_host.h12
-rw-r--r--cc/trees/layer_tree_host_impl.cc3
-rw-r--r--cc/trees/layer_tree_host_impl.h4
-rw-r--r--cc/trees/layer_tree_impl.cc2
-rw-r--r--cc/trees/layer_tree_impl.h3
-rw-r--r--cc/trees/single_thread_proxy.cc3
-rw-r--r--cc/trees/thread_proxy.cc3
8 files changed, 30 insertions, 18 deletions
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 55524af..0684a9c 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -47,17 +47,23 @@ static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number;
namespace cc {
+RendererCapabilities::RendererCapabilities(ResourceFormat best_texture_format,
+ bool allow_partial_texture_updates,
+ bool using_offscreen_context3d,
+ int max_texture_size,
+ bool using_shared_memory_resources)
+ : best_texture_format(best_texture_format),
+ allow_partial_texture_updates(allow_partial_texture_updates),
+ using_offscreen_context3d(using_offscreen_context3d),
+ max_texture_size(max_texture_size),
+ using_shared_memory_resources(using_shared_memory_resources) {}
+
RendererCapabilities::RendererCapabilities()
: best_texture_format(RGBA_8888),
- using_partial_swap(false),
- using_egl_image(false),
allow_partial_texture_updates(false),
using_offscreen_context3d(false),
max_texture_size(0),
- avoid_pow2_textures(false),
- using_map_image(false),
- using_shared_memory_resources(false),
- using_discard_framebuffer(false) {}
+ using_shared_memory_resources(false) {}
RendererCapabilities::~RendererCapabilities() {}
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index 640a70f..5aafa43 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -64,19 +64,21 @@ struct ScrollAndScaleSet;
// Provides information on an Impl's rendering capabilities back to the
// LayerTreeHost.
struct CC_EXPORT RendererCapabilities {
+ RendererCapabilities(ResourceFormat best_texture_format,
+ bool allow_partial_texture_updates,
+ bool using_offscreen_context3d,
+ int max_texture_size,
+ bool using_shared_memory_resources);
+
RendererCapabilities();
~RendererCapabilities();
+ // Duplicate any modification to this list to RendererCapabilitiesImpl.
ResourceFormat best_texture_format;
- bool using_partial_swap;
- bool using_egl_image;
bool allow_partial_texture_updates;
bool using_offscreen_context3d;
int max_texture_size;
- bool avoid_pow2_textures;
- bool using_map_image;
bool using_shared_memory_resources;
- bool using_discard_framebuffer;
};
class CC_EXPORT LayerTreeHost {
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index fbc4a82..2bd882b 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1448,7 +1448,8 @@ bool LayerTreeHostImpl::IsContextLost() {
return renderer_ && renderer_->IsContextLost();
}
-const RendererCapabilities& LayerTreeHostImpl::GetRendererCapabilities() const {
+const RendererCapabilitiesImpl&
+LayerTreeHostImpl::GetRendererCapabilities() const {
return renderer_->Capabilities();
}
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index 3f8f3a9..933b54b 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -53,7 +53,7 @@ class TextureMailboxDeleter;
class TopControlsManager;
class UIResourceBitmap;
class UIResourceRequest;
-struct RendererCapabilities;
+struct RendererCapabilitiesImpl;
// LayerTreeHost->Proxy callback interface.
class LayerTreeHostImplClient {
@@ -257,7 +257,7 @@ class CC_EXPORT LayerTreeHostImpl
bool IsContextLost();
TileManager* tile_manager() { return tile_manager_.get(); }
Renderer* renderer() { return renderer_.get(); }
- const RendererCapabilities& GetRendererCapabilities() const;
+ const RendererCapabilitiesImpl& GetRendererCapabilities() const;
virtual bool SwapBuffers(const FrameData& frame);
void SetNeedsBeginImplFrame(bool enable);
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 2d83af0..34130de 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -514,7 +514,7 @@ const LayerTreeSettings& LayerTreeImpl::settings() const {
return layer_tree_host_impl_->settings();
}
-const RendererCapabilities& LayerTreeImpl::GetRendererCapabilities() const {
+const RendererCapabilitiesImpl& LayerTreeImpl::GetRendererCapabilities() const {
return layer_tree_host_impl_->GetRendererCapabilities();
}
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
index 2f27460..7c4479d 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -14,6 +14,7 @@
#include "cc/base/scoped_ptr_vector.h"
#include "cc/base/swap_promise.h"
#include "cc/layers/layer_impl.h"
+#include "cc/output/renderer.h"
#include "cc/resources/ui_resource_client.h"
#if defined(COMPILER_GCC)
@@ -59,7 +60,7 @@ class CC_EXPORT LayerTreeImpl {
// Methods called by the layer tree that pass-through or access LTHI.
// ---------------------------------------------------------------------------
const LayerTreeSettings& settings() const;
- const RendererCapabilities& GetRendererCapabilities() const;
+ const RendererCapabilitiesImpl& GetRendererCapabilities() const;
ContextProvider* context_provider() const;
OutputSurface* output_surface() const;
ResourceProvider* resource_provider() const;
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 8bdd765..f3f028b 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -146,7 +146,8 @@ void SingleThreadProxy::CreateAndInitializeOutputSurface() {
output_surface.Pass());
if (initialized) {
renderer_capabilities_for_main_thread_ =
- layer_tree_host_impl_->GetRendererCapabilities();
+ layer_tree_host_impl_->GetRendererCapabilities()
+ .MainThreadCapabilities();
} else if (offscreen_context_provider.get()) {
offscreen_context_provider->VerifyContexts();
offscreen_context_provider = NULL;
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index a1ce1b5..931923f 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -1428,7 +1428,8 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread(
*success = layer_tree_host_impl_->InitializeRenderer(output_surface.Pass());
if (*success) {
- *capabilities = layer_tree_host_impl_->GetRendererCapabilities();
+ *capabilities = layer_tree_host_impl_->GetRendererCapabilities()
+ .MainThreadCapabilities();
scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface();
} else if (offscreen_context_provider.get()) {
if (offscreen_context_provider->BindToCurrentThread())