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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 337 |
338 void CompositorImpl::didCompleteSwapBuffers() { | 338 void CompositorImpl::didCompleteSwapBuffers() { |
339 client_->OnSwapBuffersCompleted(); | 339 client_->OnSwapBuffersCompleted(); |
340 } | 340 } |
341 | 341 |
342 void CompositorImpl::scheduleComposite() { | 342 void CompositorImpl::scheduleComposite() { |
343 client_->ScheduleComposite(); | 343 client_->ScheduleComposite(); |
344 } | 344 } |
345 | 345 |
346 class NullContextProvider : public cc::ContextProvider { | 346 class NullContextProvider : public cc::ContextProvider { |
347 virtual bool InitializeOnMainThread() { return false; } | 347 virtual bool InitializeOnMainThread() OVERRIDE { return false; } |
348 virtual bool BindToCurrentThread() { return false; } | 348 virtual bool BindToCurrentThread() OVERRIDE { return false; } |
349 virtual WebKit::WebGraphicsContext3D* Context3d() { return NULL; } | 349 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE { return NULL; } |
350 virtual class GrContext* GrContext() { return NULL; } | 350 virtual class GrContext* GrContext() OVERRIDE { return NULL; } |
351 virtual void VerifyContexts() {} | 351 virtual void VerifyContexts() OVERRIDE {} |
| 352 virtual bool DestroyedOnMainThread() OVERRIDE { return false; } |
| 353 |
352 protected: | 354 protected: |
353 virtual ~NullContextProvider() {} | 355 virtual ~NullContextProvider() {} |
354 }; | 356 }; |
355 | 357 |
356 scoped_refptr<cc::ContextProvider> | 358 scoped_refptr<cc::ContextProvider> |
357 CompositorImpl::OffscreenContextProviderForMainThread() { | 359 CompositorImpl::OffscreenContextProviderForMainThread() { |
358 // There is no support for offscreen contexts, or compositor filters that | 360 // There is no support for offscreen contexts, or compositor filters that |
359 // would require them in this compositor instance. If they are needed, | 361 // would require them in this compositor instance. If they are needed, |
360 // then implement a context provider that provides contexts from | 362 // then implement a context provider that provides contexts from |
361 // ImageTransportSurfaceAndroid. | 363 // ImageTransportSurfaceAndroid. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 case ANDROID_BITMAP_FORMAT_RGBA_8888: | 436 case ANDROID_BITMAP_FORMAT_RGBA_8888: |
435 return GL_UNSIGNED_BYTE; | 437 return GL_UNSIGNED_BYTE; |
436 break; | 438 break; |
437 case ANDROID_BITMAP_FORMAT_RGB_565: | 439 case ANDROID_BITMAP_FORMAT_RGB_565: |
438 default: | 440 default: |
439 return GL_UNSIGNED_SHORT_5_6_5; | 441 return GL_UNSIGNED_SHORT_5_6_5; |
440 } | 442 } |
441 } | 443 } |
442 | 444 |
443 } // namespace content | 445 } // namespace content |
OLD | NEW |