Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 16304003: Unified OutputSurface::SwapBuffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to 205473 Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 30 matching lines...) Expand all
41 } 41 }
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 ui::LatencyInfo&) OVERRIDE {} 52 surface_size_ = size;
53 virtual void SwapBuffers(const ui::LatencyInfo&) OVERRIDE { 53 }
54 virtual void SwapBuffers(cc::CompositorFrame*) OVERRIDE {
54 context3d()->shallowFlushCHROMIUM(); 55 context3d()->shallowFlushCHROMIUM();
55 } 56 }
56 }; 57 };
57 58
58 static bool g_initialized = false; 59 static bool g_initialized = false;
59 static webkit_glue::WebThreadImpl* g_impl_thread = NULL; 60 static webkit_glue::WebThreadImpl* g_impl_thread = NULL;
60 static bool g_use_direct_gl = false; 61 static bool g_use_direct_gl = false;
61 62
62 } // anonymous namespace 63 } // anonymous namespace
63 64
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 case ANDROID_BITMAP_FORMAT_RGBA_8888: 460 case ANDROID_BITMAP_FORMAT_RGBA_8888:
460 return GL_UNSIGNED_BYTE; 461 return GL_UNSIGNED_BYTE;
461 break; 462 break;
462 case ANDROID_BITMAP_FORMAT_RGB_565: 463 case ANDROID_BITMAP_FORMAT_RGB_565:
463 default: 464 default:
464 return GL_UNSIGNED_SHORT_5_6_5; 465 return GL_UNSIGNED_SHORT_5_6_5;
465 } 466 }
466 } 467 }
467 468
468 } // namespace content 469 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698