Bug 1021765 - Backport the fix from bug 988704 to JB-based devices as well. r=sotaro
authorVincent Liu <vliu@mozilla.com>
Sun, 08 Jun 2014 08:49:50 +0800
changeset 206769 344e71c36f9f7dab0053bc40a9bcf3056e83b004
parent 206768 5c5e7c0f31c5718ddfc35bfc95ee71f54649522b
child 206770 2dad31b192ea080a1e19cfdac9354cea6706713a
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1021765, 988704
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1021765 - Backport the fix from bug 988704 to JB-based devices as well. r=sotaro
dom/camera/GonkCameraHwMgr.cpp
widget/gonk/nativewindow/GonkNativeWindowJB.cpp
widget/gonk/nativewindow/GonkNativeWindowJB.h
--- a/dom/camera/GonkCameraHwMgr.cpp
+++ b/dom/camera/GonkCameraHwMgr.cpp
@@ -173,17 +173,17 @@ GonkCameraHardware::Init()
   mCamera->sendCommand(CAMERA_CMD_ENABLE_SHUTTER_SOUND, 0, 0);
 
 #if defined(MOZ_WIDGET_GONK)
 
 #if ANDROID_VERSION >= 19
   mNativeWindow = new GonkNativeWindow(GonkCameraHardware::MIN_UNDEQUEUED_BUFFERS);
   mCamera->setPreviewTarget(mNativeWindow->getBufferQueue());
 #elif ANDROID_VERSION >= 17
-  mNativeWindow = new GonkNativeWindow();
+  mNativeWindow = new GonkNativeWindow(GonkCameraHardware::MIN_UNDEQUEUED_BUFFERS);
   mCamera->setPreviewTexture(mNativeWindow->getBufferQueue());
 #else
   mNativeWindow = new GonkNativeWindow();
   mCamera->setPreviewTexture(mNativeWindow);
 #endif
   mNativeWindow->setNewFrameCallback(this);
   mCamera->setListener(this);
 
--- a/widget/gonk/nativewindow/GonkNativeWindowJB.cpp
+++ b/widget/gonk/nativewindow/GonkNativeWindowJB.cpp
@@ -31,20 +31,20 @@
 #define BI_LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
 #define BI_LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
 
 using namespace mozilla;
 using namespace mozilla::layers;
 
 namespace android {
 
-GonkNativeWindow::GonkNativeWindow() :
+GonkNativeWindow::GonkNativeWindow(int bufferCount) :
     GonkConsumerBase(new GonkBufferQueue(true) )
 {
-    mBufferQueue->setMaxAcquiredBufferCount(GonkBufferQueue::MIN_UNDEQUEUED_BUFFERS);
+    mBufferQueue->setMaxAcquiredBufferCount(bufferCount);
 }
 
 GonkNativeWindow::~GonkNativeWindow() {
 }
 
 void GonkNativeWindow::setName(const String8& name) {
     Mutex::Autolock _l(mMutex);
     mName = name;
--- a/widget/gonk/nativewindow/GonkNativeWindowJB.h
+++ b/widget/gonk/nativewindow/GonkNativeWindowJB.h
@@ -59,17 +59,17 @@ class GonkNativeWindow: public GonkConsu
 
     enum { INVALID_BUFFER_SLOT = GonkBufferQueue::INVALID_BUFFER_SLOT };
     enum { NO_BUFFER_AVAILABLE = GonkBufferQueue::NO_BUFFER_AVAILABLE };
 
     // Create a new buffer item consumer. The consumerUsage parameter determines
     // the consumer usage flags passed to the graphics allocator. The
     // bufferCount parameter specifies how many buffers can be locked for user
     // access at the same time.
-    GonkNativeWindow();
+    GonkNativeWindow(int bufferCount = GonkBufferQueue::MIN_UNDEQUEUED_BUFFERS);
 
     virtual ~GonkNativeWindow();
 
     // set the name of the GonkNativeWindow that will be used to identify it in
     // log messages.
     void setName(const String8& name);
 
     // Gets the next graphics buffer from the producer, filling out the