summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorbrianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-09 04:03:38 +0000
committerbrianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-09 04:03:38 +0000
commit1a968fbbe373059cad27709b45faa5a7ec0ef88b (patch)
treee3afdf880024bc9226ab55d48edecf9bca2571bd /cc
parent06293aa1e410e5a60b31f08b24f9204c5c4e2929 (diff)
downloadchromium_src-1a968fbbe373059cad27709b45faa5a7ec0ef88b.zip
chromium_src-1a968fbbe373059cad27709b45faa5a7ec0ef88b.tar.gz
chromium_src-1a968fbbe373059cad27709b45faa5a7ec0ef88b.tar.bz2
cc: Remove disabled LatencyQuery logic in OutputSurface
We can add this back when we figure out why it was causing flickering on some devices. BUG=317928 Review URL: https://codereview.chromium.org/323423005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/output/output_surface.cc103
-rw-r--r--cc/output/output_surface.h9
2 files changed, 3 insertions, 109 deletions
diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc
index 46096d2..369a152 100644
--- a/cc/output/output_surface.cc
+++ b/cc/output/output_surface.cc
@@ -21,7 +21,6 @@
#include "cc/output/managed_memory_policy.h"
#include "cc/output/output_surface_client.h"
#include "cc/scheduler/delay_based_time_source.h"
-#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/khronos/GLES2/gl2.h"
@@ -34,13 +33,6 @@ using std::set;
using std::string;
using std::vector;
-namespace {
-
-const size_t kGpuLatencyHistorySize = 60;
-const double kGpuLatencyEstimationPercentile = 100.0;
-
-}
-
namespace cc {
OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider)
@@ -48,8 +40,7 @@ OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider)
context_provider_(context_provider),
device_scale_factor_(-1),
external_stencil_test_enabled_(false),
- weak_ptr_factory_(this),
- gpu_latency_history_(kGpuLatencyHistorySize) {
+ weak_ptr_factory_(this) {
}
OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device)
@@ -57,8 +48,7 @@ OutputSurface::OutputSurface(scoped_ptr<SoftwareOutputDevice> software_device)
software_device_(software_device.Pass()),
device_scale_factor_(-1),
external_stencil_test_enabled_(false),
- weak_ptr_factory_(this),
- gpu_latency_history_(kGpuLatencyHistorySize) {
+ weak_ptr_factory_(this) {
}
OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider,
@@ -68,8 +58,7 @@ OutputSurface::OutputSurface(scoped_refptr<ContextProvider> context_provider,
software_device_(software_device.Pass()),
device_scale_factor_(-1),
external_stencil_test_enabled_(false),
- weak_ptr_factory_(this),
- gpu_latency_history_(kGpuLatencyHistorySize) {
+ weak_ptr_factory_(this) {
}
void OutputSurface::CommitVSyncParameters(base::TimeTicks timebase,
@@ -95,8 +84,6 @@ void OutputSurface::ReclaimResources(const CompositorFrameAck* ack) {
void OutputSurface::DidLoseOutputSurface() {
TRACE_EVENT0("cc", "OutputSurface::DidLoseOutputSurface");
- pending_gpu_latency_query_ids_.clear();
- available_gpu_latency_query_ids_.clear();
client_->DidLoseOutputSurface();
}
@@ -189,16 +176,6 @@ void OutputSurface::ReleaseContextProvider() {
void OutputSurface::ResetContext3d() {
if (context_provider_.get()) {
- while (!pending_gpu_latency_query_ids_.empty()) {
- unsigned query_id = pending_gpu_latency_query_ids_.front();
- pending_gpu_latency_query_ids_.pop_front();
- context_provider_->ContextGL()->DeleteQueriesEXT(1, &query_id);
- }
- while (!available_gpu_latency_query_ids_.empty()) {
- unsigned query_id = available_gpu_latency_query_ids_.front();
- available_gpu_latency_query_ids_.pop_front();
- context_provider_->ContextGL()->DeleteQueriesEXT(1, &query_id);
- }
context_provider_->SetLostContextCallback(
ContextProvider::LostContextCallback());
context_provider_->SetMemoryPolicyChangedCallback(
@@ -254,7 +231,6 @@ void OutputSurface::SwapBuffers(CompositorFrame* frame) {
DCHECK(context_provider_);
DCHECK(frame->gl_frame_data);
- UpdateAndMeasureGpuLatency();
if (frame->gl_frame_data->sub_buffer_rect ==
gfx::Rect(frame->gl_frame_data->size)) {
context_provider_->ContextSupport()->Swap();
@@ -266,79 +242,6 @@ void OutputSurface::SwapBuffers(CompositorFrame* frame) {
client_->DidSwapBuffers();
}
-base::TimeDelta OutputSurface::GpuLatencyEstimate() {
- if (context_provider_ && !capabilities_.adjust_deadline_for_parent)
- return gpu_latency_history_.Percentile(kGpuLatencyEstimationPercentile);
- else
- return base::TimeDelta();
-}
-
-void OutputSurface::UpdateAndMeasureGpuLatency() {
- // http://crbug.com/306690 tracks re-enabling latency queries.
-#if 0
- // We only care about GPU latency for surfaces that do not have a parent
- // compositor, since surfaces that do have a parent compositor can use
- // mailboxes or delegated rendering to send frames to their parent without
- // incurring GPU latency.
- if (capabilities_.adjust_deadline_for_parent)
- return;
-
- while (pending_gpu_latency_query_ids_.size()) {
- unsigned query_id = pending_gpu_latency_query_ids_.front();
- unsigned query_complete = 1;
- context_provider_->ContextGL()->GetQueryObjectuivEXT(
- query_id, GL_QUERY_RESULT_AVAILABLE_EXT, &query_complete);
- if (!query_complete)
- break;
-
- unsigned value = 0;
- context_provider_->ContextGL()->GetQueryObjectuivEXT(
- query_id, GL_QUERY_RESULT_EXT, &value);
- pending_gpu_latency_query_ids_.pop_front();
- available_gpu_latency_query_ids_.push_back(query_id);
-
- base::TimeDelta latency = base::TimeDelta::FromMicroseconds(value);
- base::TimeDelta latency_estimate = GpuLatencyEstimate();
- gpu_latency_history_.InsertSample(latency);
-
- base::TimeDelta latency_overestimate;
- base::TimeDelta latency_underestimate;
- if (latency > latency_estimate)
- latency_underestimate = latency - latency_estimate;
- else
- latency_overestimate = latency_estimate - latency;
- UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.GpuLatency",
- latency,
- base::TimeDelta::FromMilliseconds(1),
- base::TimeDelta::FromMilliseconds(100),
- 50);
- UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.GpuLatencyUnderestimate",
- latency_underestimate,
- base::TimeDelta::FromMilliseconds(1),
- base::TimeDelta::FromMilliseconds(100),
- 50);
- UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.GpuLatencyOverestimate",
- latency_overestimate,
- base::TimeDelta::FromMilliseconds(1),
- base::TimeDelta::FromMilliseconds(100),
- 50);
- }
-
- unsigned gpu_latency_query_id;
- if (available_gpu_latency_query_ids_.size()) {
- gpu_latency_query_id = available_gpu_latency_query_ids_.front();
- available_gpu_latency_query_ids_.pop_front();
- } else {
- context_provider_->ContextGL()->GenQueriesEXT(1, &gpu_latency_query_id);
- }
-
- context_provider_->ContextGL()->BeginQueryEXT(GL_LATENCY_QUERY_CHROMIUM,
- gpu_latency_query_id);
- context_provider_->ContextGL()->EndQueryEXT(GL_LATENCY_QUERY_CHROMIUM);
- pending_gpu_latency_query_ids_.push_back(gpu_latency_query_id);
-#endif
-}
-
void OutputSurface::PostSwapBuffersComplete() {
base::MessageLoop::current()->PostTask(
FROM_HERE,
diff --git a/cc/output/output_surface.h b/cc/output/output_surface.h
index 98a4830..4ba3e5f 100644
--- a/cc/output/output_surface.h
+++ b/cc/output/output_surface.h
@@ -138,10 +138,6 @@ class CC_EXPORT OutputSurface {
bool HasClient() { return !!client_; }
- // Returns an estimate of the current GPU latency. When only a software
- // device is present, returns 0.
- base::TimeDelta GpuLatencyEstimate();
-
// Get the class capable of informing cc of hardware overlay capability.
OverlayCandidateValidator* overlay_candidate_validator() const {
return overlay_candidate_validator_.get();
@@ -181,16 +177,11 @@ class CC_EXPORT OutputSurface {
void SetUpContext3d();
void ResetContext3d();
void SetMemoryPolicy(const ManagedMemoryPolicy& policy);
- void UpdateAndMeasureGpuLatency();
bool external_stencil_test_enabled_;
base::WeakPtrFactory<OutputSurface> weak_ptr_factory_;
- std::deque<unsigned> available_gpu_latency_query_ids_;
- std::deque<unsigned> pending_gpu_latency_query_ids_;
- RollingTimeDeltaHistory gpu_latency_history_;
-
DISALLOW_COPY_AND_ASSIGN(OutputSurface);
};