| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/aura/no_transport_image_transport_factory.h" | 5 #include "content/browser/aura/no_transport_image_transport_factory.h" |
| 6 | 6 |
| 7 #include "cc/output/context_provider.h" | 7 #include "cc/output/context_provider.h" |
| 8 #include "content/common/gpu/client/gl_helper.h" | 8 #include "content/common/gpu/client/gl_helper.h" |
| 9 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 9 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 10 #include "ui/compositor/compositor.h" | 10 #include "ui/compositor/compositor.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 class FakeTexture : public ui::Texture { | 16 class FakeTexture : public ui::Texture { |
| 17 public: | 17 public: |
| 18 FakeTexture(scoped_refptr<cc::ContextProvider> context_provider, | 18 FakeTexture(scoped_refptr<cc::ContextProvider> context_provider, |
| 19 float device_scale_factor) | 19 float device_scale_factor) |
| 20 : ui::Texture(false, gfx::Size(), device_scale_factor), | 20 : ui::Texture(false, gfx::Size(), device_scale_factor), |
| 21 context_provider_(context_provider), | 21 context_provider_(context_provider), |
| 22 texture_(context_provider_->Context3d()->createTexture()) {} | 22 texture_(context_provider_->Context3d()->createTexture()) {} |
| 23 | 23 |
| 24 virtual unsigned int PrepareTexture() OVERRIDE { return texture_; } | 24 virtual unsigned int PrepareTexture() OVERRIDE { return texture_; } |
| 25 virtual WebKit::WebGraphicsContext3D* HostContext3D() OVERRIDE { | 25 virtual blink::WebGraphicsContext3D* HostContext3D() OVERRIDE { |
| 26 return context_provider_->Context3d(); | 26 return context_provider_->Context3d(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 virtual void Consume(const std::string& mailbox_name, | 29 virtual void Consume(const std::string& mailbox_name, |
| 30 const gfx::Size& new_size) OVERRIDE { | 30 const gfx::Size& new_size) OVERRIDE { |
| 31 size_ = new_size; | 31 size_ = new_size; |
| 32 } | 32 } |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 virtual ~FakeTexture() { | 35 virtual ~FakeTexture() { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // We don't generate lost context events, so we don't need to keep track of | 91 // We don't generate lost context events, so we don't need to keep track of |
| 92 // observers | 92 // observers |
| 93 void NoTransportImageTransportFactory::AddObserver( | 93 void NoTransportImageTransportFactory::AddObserver( |
| 94 ImageTransportFactoryObserver* observer) {} | 94 ImageTransportFactoryObserver* observer) {} |
| 95 | 95 |
| 96 void NoTransportImageTransportFactory::RemoveObserver( | 96 void NoTransportImageTransportFactory::RemoveObserver( |
| 97 ImageTransportFactoryObserver* observer) {} | 97 ImageTransportFactoryObserver* observer) {} |
| 98 | 98 |
| 99 } // namespace content | 99 } // namespace content |
| OLD | NEW |