Chromium Code Reviews| 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/compositor_impl_android.h" | 5 #include "content/browser/renderer_host/compositor_impl_android.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 | 321 |
| 322 void CompositorImpl::didCompleteSwapBuffers() { | 322 void CompositorImpl::didCompleteSwapBuffers() { |
| 323 client_->OnSwapBuffersCompleted(); | 323 client_->OnSwapBuffersCompleted(); |
| 324 } | 324 } |
| 325 | 325 |
| 326 void CompositorImpl::scheduleComposite() { | 326 void CompositorImpl::scheduleComposite() { |
| 327 client_->ScheduleComposite(); | 327 client_->ScheduleComposite(); |
| 328 } | 328 } |
| 329 | 329 |
| 330 class NullContextProvider : public cc::ContextProvider { | 330 class NullContextProvider : public cc::ContextProvider { |
| 331 virtual bool InitializeOnMainThread() { return false; } | 331 virtual bool InitializeOnMainThread() OVERRIDE { return false; } |
| 332 virtual bool BindToCurrentThread() { return false; } | 332 virtual bool BindToCurrentThread() OVERRIDE { return false; } |
| 333 virtual WebKit::WebGraphicsContext3D* Context3d() { return NULL; } | 333 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE { return NULL; } |
| 334 virtual class GrContext* GrContext() { return NULL; } | 334 virtual class GrContext* GrContext() OVERRIDE { return NULL; } |
| 335 virtual void VerifyContexts() {} | 335 virtual void VerifyContexts() OVERRIDE {} |
| 336 virtual bool DestroyedOnMainThread() OVERRIDE { return false; } | |
| 336 protected: | 337 protected: |
|
piman
2013/03/06 01:08:59
nit: blank line before 'protected:'
danakj
2013/03/06 01:41:32
Done.
| |
| 337 virtual ~NullContextProvider() {} | 338 virtual ~NullContextProvider() {} |
| 338 }; | 339 }; |
| 339 | 340 |
| 340 scoped_refptr<cc::ContextProvider> | 341 scoped_refptr<cc::ContextProvider> |
| 341 CompositorImpl::OffscreenContextProviderForMainThread() { | 342 CompositorImpl::OffscreenContextProviderForMainThread() { |
| 342 // There is no support for offscreen contexts, or compositor filters that | 343 // There is no support for offscreen contexts, or compositor filters that |
| 343 // would require them in this compositor instance. If they are needed, | 344 // would require them in this compositor instance. If they are needed, |
| 344 // then implement a context provider that provides contexts from | 345 // then implement a context provider that provides contexts from |
| 345 // ImageTransportSurfaceAndroid. | 346 // ImageTransportSurfaceAndroid. |
| 346 if (!null_offscreen_context_provider_) | 347 if (!null_offscreen_context_provider_) |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 418 case ANDROID_BITMAP_FORMAT_RGBA_8888: | 419 case ANDROID_BITMAP_FORMAT_RGBA_8888: |
| 419 return GL_UNSIGNED_BYTE; | 420 return GL_UNSIGNED_BYTE; |
| 420 break; | 421 break; |
| 421 case ANDROID_BITMAP_FORMAT_RGB_565: | 422 case ANDROID_BITMAP_FORMAT_RGB_565: |
| 422 default: | 423 default: |
| 423 return GL_UNSIGNED_SHORT_5_6_5; | 424 return GL_UNSIGNED_SHORT_5_6_5; |
| 424 } | 425 } |
| 425 } | 426 } |
| 426 | 427 |
| 427 } // namespace content | 428 } // namespace content |
| OLD | NEW |