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

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 470233003: Restrict ETC1 power-of-two rounding to old IMG drivers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 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 | « content/browser/renderer_host/compositor_impl_android.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 13b0735eee52663f2d68c497a30216b7d277ebd0..b0c3aeaa97af72743d032c46c60d923e77d5c728 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -14,6 +14,7 @@
#include "base/containers/hash_tables.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread.h"
@@ -56,9 +57,12 @@ const unsigned int kMaxSwapBuffers = 2U;
class OutputSurfaceWithoutParent : public cc::OutputSurface {
public:
OutputSurfaceWithoutParent(const scoped_refptr<
- content::ContextProviderCommandBuffer>& context_provider)
+ content::ContextProviderCommandBuffer>& context_provider,
+ base::WeakPtr<content::CompositorImpl> compositor_impl)
: cc::OutputSurface(context_provider) {
capabilities_.adjust_deadline_for_parent = false;
+ compositor_impl_ = compositor_impl;
+ main_thread_ = base::MessageLoopProxy::current();
}
virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE {
@@ -72,6 +76,22 @@ class OutputSurfaceWithoutParent : public cc::OutputSurface {
OutputSurface::SwapBuffers(frame);
}
+
+ virtual bool BindToClient(cc::OutputSurfaceClient* client) OVERRIDE {
+ if (!OutputSurface::BindToClient(client))
+ return false;
+
+ main_thread_->PostTask(
+ FROM_HERE,
+ base::Bind(&content::CompositorImpl::PopulateGpuCapabilities,
+ compositor_impl_,
+ context_provider_->ContextCapabilities().gpu));
+
+ return true;
+ }
+
+ scoped_refptr<base::MessageLoopProxy> main_thread_;
+ base::WeakPtr<content::CompositorImpl> compositor_impl_;
};
class SurfaceTextureTrackerImpl : public gfx::SurfaceTextureTracker {
@@ -552,8 +572,14 @@ scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface(
return scoped_ptr<cc::OutputSurface>();
}
- return scoped_ptr<cc::OutputSurface>(
- new OutputSurfaceWithoutParent(context_provider));
+ return scoped_ptr<cc::OutputSurface>(new OutputSurfaceWithoutParent(
+ context_provider, weak_factory_.GetWeakPtr()));
+}
+
+void CompositorImpl::PopulateGpuCapabilities(
+ gpu::Capabilities gpu_capabilities) {
+ ui_resource_provider_.SetSupportsETC1NonPowerOfTwo(
+ gpu_capabilities.texture_format_etc1_npot);
}
void CompositorImpl::OnLostResources() {
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698