| Index: cc/output/output_surface.cc
|
| diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc
|
| index 46096d2e3094febd271e31a47c8668fbc1158ea2..369a152ea9d2371cb90f4c42562d6305775ad40b 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,
|
|
|