OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/image_transport_factory.h" | 5 #include "content/browser/renderer_host/image_transport_factory.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 if (base::StringToInt(string_value, &int_value)) | 503 if (base::StringToInt(string_value, &int_value)) |
504 capabilities_.max_frames_pending = int_value; | 504 capabilities_.max_frames_pending = int_value; |
505 else | 505 else |
506 LOG(ERROR) << "Trouble parsing --" << switches::kUIMaxFramesPending; | 506 LOG(ERROR) << "Trouble parsing --" << switches::kUIMaxFramesPending; |
507 } | 507 } |
508 DetachFromThread(); | 508 DetachFromThread(); |
509 } | 509 } |
510 | 510 |
511 virtual ~BrowserCompositorOutputSurface() { | 511 virtual ~BrowserCompositorOutputSurface() { |
512 DCHECK(CalledOnValidThread()); | 512 DCHECK(CalledOnValidThread()); |
513 if (!HasClient()) | 513 if (!client_) |
514 return; | 514 return; |
515 output_surface_proxy_->RemoveSurface(surface_id_); | 515 output_surface_proxy_->RemoveSurface(surface_id_); |
516 } | 516 } |
517 | 517 |
518 virtual bool BindToClient( | 518 virtual bool BindToClient( |
519 cc::OutputSurfaceClient* client) OVERRIDE { | 519 cc::OutputSurfaceClient* client) OVERRIDE { |
520 DCHECK(CalledOnValidThread()); | 520 DCHECK(CalledOnValidThread()); |
521 | 521 |
522 if (!OutputSurface::BindToClient(client)) | 522 if (!OutputSurface::BindToClient(client)) |
523 return false; | 523 return false; |
524 | 524 |
525 output_surface_proxy_->AddSurface(this, surface_id_); | 525 output_surface_proxy_->AddSurface(this, surface_id_); |
526 return true; | 526 return true; |
527 } | 527 } |
528 | 528 |
529 void OnUpdateVSyncParameters( | 529 void OnUpdateVSyncParameters( |
530 base::TimeTicks timebase, base::TimeDelta interval) { | 530 base::TimeTicks timebase, base::TimeDelta interval) { |
531 DCHECK(CalledOnValidThread()); | 531 DCHECK(CalledOnValidThread()); |
532 DCHECK(HasClient()); | 532 DCHECK(client_); |
533 OnVSyncParametersChanged(timebase, interval); | 533 client_->OnVSyncParametersChanged(timebase, interval); |
534 compositor_message_loop_->PostTask( | 534 compositor_message_loop_->PostTask( |
535 FROM_HERE, | 535 FROM_HERE, |
536 base::Bind(&ui::Compositor::OnUpdateVSyncParameters, | 536 base::Bind(&ui::Compositor::OnUpdateVSyncParameters, |
537 compositor_, timebase, interval)); | 537 compositor_, timebase, interval)); |
538 } | 538 } |
539 | 539 |
540 virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE { | 540 virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE { |
541 OutputSurface::Reshape(size, scale_factor); | 541 OutputSurface::Reshape(size, scale_factor); |
542 if (reflector_.get()) | 542 if (reflector_.get()) |
543 reflector_->OnReshape(size); | 543 reflector_->OnReshape(size); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 delete g_factory; | 1064 delete g_factory; |
1065 g_factory = NULL; | 1065 g_factory = NULL; |
1066 } | 1066 } |
1067 | 1067 |
1068 // static | 1068 // static |
1069 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 1069 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
1070 return g_factory; | 1070 return g_factory; |
1071 } | 1071 } |
1072 | 1072 |
1073 } // namespace content | 1073 } // namespace content |
OLD | NEW |