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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 if (base::StringToInt(string_value, &int_value)) | 500 if (base::StringToInt(string_value, &int_value)) |
501 capabilities_.max_frames_pending = int_value; | 501 capabilities_.max_frames_pending = int_value; |
502 else | 502 else |
503 LOG(ERROR) << "Trouble parsing --" << switches::kUIMaxFramesPending; | 503 LOG(ERROR) << "Trouble parsing --" << switches::kUIMaxFramesPending; |
504 } | 504 } |
505 DetachFromThread(); | 505 DetachFromThread(); |
506 } | 506 } |
507 | 507 |
508 virtual ~BrowserCompositorOutputSurface() { | 508 virtual ~BrowserCompositorOutputSurface() { |
509 DCHECK(CalledOnValidThread()); | 509 DCHECK(CalledOnValidThread()); |
510 if (!client_) | 510 if (!HasClient()) |
511 return; | 511 return; |
512 output_surface_proxy_->RemoveSurface(surface_id_); | 512 output_surface_proxy_->RemoveSurface(surface_id_); |
513 } | 513 } |
514 | 514 |
515 virtual bool BindToClient( | 515 virtual bool BindToClient( |
516 cc::OutputSurfaceClient* client) OVERRIDE { | 516 cc::OutputSurfaceClient* client) OVERRIDE { |
517 DCHECK(CalledOnValidThread()); | 517 DCHECK(CalledOnValidThread()); |
518 | 518 |
519 if (!OutputSurface::BindToClient(client)) | 519 if (!OutputSurface::BindToClient(client)) |
520 return false; | 520 return false; |
521 | 521 |
522 output_surface_proxy_->AddSurface(this, surface_id_); | 522 output_surface_proxy_->AddSurface(this, surface_id_); |
523 return true; | 523 return true; |
524 } | 524 } |
525 | 525 |
526 void OnUpdateVSyncParameters( | 526 void OnUpdateVSyncParameters( |
527 base::TimeTicks timebase, base::TimeDelta interval) { | 527 base::TimeTicks timebase, base::TimeDelta interval) { |
528 DCHECK(CalledOnValidThread()); | 528 DCHECK(CalledOnValidThread()); |
529 DCHECK(client_); | 529 DCHECK(HasClient()); |
530 client_->OnVSyncParametersChanged(timebase, interval); | 530 OnVSyncParametersChanged(timebase, interval); |
531 compositor_message_loop_->PostTask( | 531 compositor_message_loop_->PostTask( |
532 FROM_HERE, | 532 FROM_HERE, |
533 base::Bind(&ui::Compositor::OnUpdateVSyncParameters, | 533 base::Bind(&ui::Compositor::OnUpdateVSyncParameters, |
534 compositor_, timebase, interval)); | 534 compositor_, timebase, interval)); |
535 } | 535 } |
536 | 536 |
537 virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE { | 537 virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE { |
538 OutputSurface::Reshape(size, scale_factor); | 538 OutputSurface::Reshape(size, scale_factor); |
539 if (reflector_.get()) | 539 if (reflector_.get()) |
540 reflector_->OnReshape(size); | 540 reflector_->OnReshape(size); |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 delete g_factory; | 1047 delete g_factory; |
1048 g_factory = NULL; | 1048 g_factory = NULL; |
1049 } | 1049 } |
1050 | 1050 |
1051 // static | 1051 // static |
1052 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 1052 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
1053 return g_factory; | 1053 return g_factory; |
1054 } | 1054 } |
1055 | 1055 |
1056 } // namespace content | 1056 } // namespace content |
OLD | NEW |