| 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 | 521 |
| 522 gfx::AcceleratedWidget widget = compositor->widget(); | 522 gfx::AcceleratedWidget widget = compositor->widget(); |
| 523 GpuSurfaceTracker* tracker = GpuSurfaceTracker::Get(); | 523 GpuSurfaceTracker* tracker = GpuSurfaceTracker::Get(); |
| 524 | 524 |
| 525 PerCompositorData* data = new PerCompositorData; | 525 PerCompositorData* data = new PerCompositorData; |
| 526 data->surface_id = tracker->AddSurfaceForNativeWidget(widget); | 526 data->surface_id = tracker->AddSurfaceForNativeWidget(widget); |
| 527 data->swap_client.reset(new CompositorSwapClient(compositor, this)); | 527 data->swap_client.reset(new CompositorSwapClient(compositor, this)); |
| 528 #if defined(OS_WIN) | 528 #if defined(OS_WIN) |
| 529 if (GpuDataManagerImpl::GetInstance()->IsUsingAcceleratedSurface()) | 529 if (GpuDataManagerImpl::GetInstance()->IsUsingAcceleratedSurface()) |
| 530 data->accelerated_surface.reset(new AcceleratedSurface(widget)); | 530 data->accelerated_surface.reset(new AcceleratedSurface(widget)); |
| 531 tracker->SetSurfaceHandle( | 531 #endif |
| 532 data->surface_id, | |
| 533 gfx::GLSurfaceHandle(widget, true)); | |
| 534 #else | |
| 535 tracker->SetSurfaceHandle( | 532 tracker->SetSurfaceHandle( |
| 536 data->surface_id, | 533 data->surface_id, |
| 537 gfx::GLSurfaceHandle(widget, false)); | 534 gfx::GLSurfaceHandle(widget, false)); |
| 538 #endif | |
| 539 | 535 |
| 540 per_compositor_data_[compositor] = data; | 536 per_compositor_data_[compositor] = data; |
| 541 | 537 |
| 542 return data; | 538 return data; |
| 543 } | 539 } |
| 544 | 540 |
| 545 WebGraphicsContext3DCommandBufferImpl* CreateContextCommon( | 541 WebGraphicsContext3DCommandBufferImpl* CreateContextCommon( |
| 546 const base::WeakPtr<WebGraphicsContext3DSwapBuffersClient>& swap_client, | 542 const base::WeakPtr<WebGraphicsContext3DSwapBuffersClient>& swap_client, |
| 547 int surface_id) { | 543 int surface_id) { |
| 548 WebKit::WebGraphicsContext3D::Attributes attrs; | 544 WebKit::WebGraphicsContext3D::Attributes attrs; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 delete g_factory; | 640 delete g_factory; |
| 645 g_factory = NULL; | 641 g_factory = NULL; |
| 646 } | 642 } |
| 647 | 643 |
| 648 // static | 644 // static |
| 649 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 645 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
| 650 return g_factory; | 646 return g_factory; |
| 651 } | 647 } |
| 652 | 648 |
| 653 } // namespace content | 649 } // namespace content |
| OLD | NEW |