summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-13 22:24:23 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-13 22:24:23 +0000
commite378017475a9b54c5aa83ec4c1be48d0ff4736d9 (patch)
tree415285a5726159814ae5b38094e3ff74ef77a4bc /cc
parent8dfaada9fa663cf78e3eaad3ae3c146e3b60cd4d (diff)
downloadchromium_src-e378017475a9b54c5aa83ec4c1be48d0ff4736d9.zip
chromium_src-e378017475a9b54c5aa83ec4c1be48d0ff4736d9.tar.gz
chromium_src-e378017475a9b54c5aa83ec4c1be48d0ff4736d9.tar.bz2
Use software compositor for windows under 64 pixels wide or tall.
They're broken on AMD drivers. Switch back and forth between software and hardware using lost device on the output surface on resize. BUG=286609 R=jamesr@chromium.org Review URL: https://codereview.chromium.org/61323003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234928 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/output/output_surface.cc12
-rw-r--r--cc/output/output_surface.h5
-rw-r--r--cc/trees/layer_tree_host_impl.cc2
3 files changed, 16 insertions, 3 deletions
diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc
index 749527e..9820ee28 100644
--- a/cc/output/output_surface.cc
+++ b/cc/output/output_surface.cc
@@ -55,7 +55,8 @@ OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider)
check_for_retroactive_begin_impl_frame_pending_(false),
external_stencil_test_enabled_(false),
weak_ptr_factory_(this),
- gpu_latency_history_(kGpuLatencyHistorySize) {}
+ gpu_latency_history_(kGpuLatencyHistorySize),
+ is_lost_(false) {}
OutputSurface::OutputSurface(
scoped_ptr<cc::SoftwareOutputDevice> software_device)
@@ -71,7 +72,8 @@ OutputSurface::OutputSurface(
check_for_retroactive_begin_impl_frame_pending_(false),
external_stencil_test_enabled_(false),
weak_ptr_factory_(this),
- gpu_latency_history_(kGpuLatencyHistorySize) {}
+ gpu_latency_history_(kGpuLatencyHistorySize),
+ is_lost_(false) {}
OutputSurface::OutputSurface(
scoped_refptr<ContextProvider> context_provider,
@@ -89,7 +91,8 @@ OutputSurface::OutputSurface(
check_for_retroactive_begin_impl_frame_pending_(false),
external_stencil_test_enabled_(false),
weak_ptr_factory_(this),
- gpu_latency_history_(kGpuLatencyHistorySize) {}
+ gpu_latency_history_(kGpuLatencyHistorySize),
+ is_lost_(false) {}
void OutputSurface::InitializeBeginImplFrameEmulation(
base::SingleThreadTaskRunner* task_runner,
@@ -242,8 +245,11 @@ void OutputSurface::DidLoseOutputSurface() {
pending_gpu_latency_query_ids_.clear();
available_gpu_latency_query_ids_.clear();
client_->DidLoseOutputSurface();
+ is_lost_ = true;
}
+bool OutputSurface::IsLost() { return is_lost_; }
+
void OutputSurface::SetExternalStencilTest(bool enabled) {
external_stencil_test_enabled_ = enabled;
}
diff --git a/cc/output/output_surface.h b/cc/output/output_surface.h
index efe0ea2..7cafbd9 100644
--- a/cc/output/output_surface.h
+++ b/cc/output/output_surface.h
@@ -139,6 +139,9 @@ class CC_EXPORT OutputSurface : public FrameRateControllerClient {
// device is present, returns 0.
base::TimeDelta GpuLatencyEstimate();
+ // Has the output surface been lost.
+ bool IsLost();
+
protected:
// Synchronously initialize context3d and enter hardware mode.
// This can only supported in threaded compositing mode.
@@ -214,6 +217,8 @@ class CC_EXPORT OutputSurface : public FrameRateControllerClient {
std::deque<unsigned> pending_gpu_latency_query_ids_;
RollingTimeDeltaHistory gpu_latency_history_;
+ bool is_lost_;
+
DISALLOW_COPY_AND_ASSIGN(OutputSurface);
};
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 53afea7..0af1036 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1392,6 +1392,8 @@ void LayerTreeHostImpl::FinishAllRendering() {
bool LayerTreeHostImpl::IsContextLost() {
DCHECK(proxy_->IsImplThread());
+ if (output_surface_ && output_surface_->IsLost())
+ return true;
return renderer_ && renderer_->IsContextLost();
}