| 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 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 | 44 |
| 45 // Used for drawing directly to the screen. Bypasses resizing and swaps. | 45 // Used for drawing directly to the screen. Bypasses resizing and swaps. |
| 46 class DirectOutputSurface : public cc::OutputSurface { | 46 class DirectOutputSurface : public cc::OutputSurface { |
| 47 public: | 47 public: |
| 48 DirectOutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d) | 48 DirectOutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d) |
| 49 : cc::OutputSurface(context3d.Pass()) {} | 49 : cc::OutputSurface(context3d.Pass()) {} |
| 50 | 50 |
| 51 virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE {} | 51 virtual void Reshape(gfx::Size size, float scale_factor) OVERRIDE {} |
| 52 virtual void PostSubBuffer(gfx::Rect rect, const cc::LatencyInfo&) OVERRIDE {} | 52 virtual void PostSubBuffer(gfx::Rect rect, const ui::LatencyInfo&) OVERRIDE {} |
| 53 virtual void SwapBuffers(const cc::LatencyInfo&) OVERRIDE { | 53 virtual void SwapBuffers(const ui::LatencyInfo&) OVERRIDE { |
| 54 context3d()->shallowFlushCHROMIUM(); | 54 context3d()->shallowFlushCHROMIUM(); |
| 55 } | 55 } |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 static bool g_initialized = false; | 58 static bool g_initialized = false; |
| 59 static webkit_glue::WebThreadImpl* g_impl_thread = NULL; | 59 static webkit_glue::WebThreadImpl* g_impl_thread = NULL; |
| 60 static bool g_use_direct_gl = false; | 60 static bool g_use_direct_gl = false; |
| 61 | 61 |
| 62 } // anonymous namespace | 62 } // anonymous namespace |
| 63 | 63 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 case ANDROID_BITMAP_FORMAT_RGBA_8888: | 458 case ANDROID_BITMAP_FORMAT_RGBA_8888: |
| 459 return GL_UNSIGNED_BYTE; | 459 return GL_UNSIGNED_BYTE; |
| 460 break; | 460 break; |
| 461 case ANDROID_BITMAP_FORMAT_RGB_565: | 461 case ANDROID_BITMAP_FORMAT_RGB_565: |
| 462 default: | 462 default: |
| 463 return GL_UNSIGNED_SHORT_5_6_5; | 463 return GL_UNSIGNED_SHORT_5_6_5; |
| 464 } | 464 } |
| 465 } | 465 } |
| 466 | 466 |
| 467 } // namespace content | 467 } // namespace content |
| OLD | NEW |