title: Set height width of ANativeWindow android
body: <p>I am developing one application where I want to set the height width of the surface view and native window.
  I am setting surface view height width using layout params. For example, if I am setting 500 height and 500 width to surface view and native window then my native window doesn't fit with my surface view. It seems like surface view takes some extra width and height. Below is my code.</p>
  <p>Surfaceview</p>
  <pre><code>ConstraintLayout.LayoutParams params = new ConstraintLayout.LayoutParams(500, 500);
          params.startToStart = ConstraintSet.PARENT_ID;
          params.endToEnd = ConstraintSet.PARENT_ID;
          params.topToTop = ConstraintSet.PARENT_ID;
          params.bottomToBottom = ConstraintSet.PARENT_ID;
  
          surfaceView.setLayoutParams(params);
  </code></pre>
  <p>Antivewindow :</p>
  <pre><code>ANativeWindow_setBuffersGeometry(new_native_window, 500, 500, WINDOW_FORMAT_RGBA_8888);
  </code></pre>
  <p>After setting 500 width and height my view sets according to below image.
  <a href="https://i.stack.imgur.com/9XAJD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9XAJD.png" alt="enter image description here" /></a></p>
  <p>Why my native window always sets some rectangle stracture. Am I doing anything wrong or any parameters are missing while setting these native window params? I tried some scale mode for the native window but none worked. Any help regarding same?</p>