frameworks/base: make the ANativeWindow query() method const
query() does not modify the object's data, so it needs to be a const method Change-Id: I67c40a3c865461e6f1cc2193fd2d74286ff6ac8f Signed-off-by: Iliyan Malchev <malchev@google.com>
This commit is contained in:
parent
5b495067a0
commit
41abd67302
|
@ -49,7 +49,7 @@ private:
|
|||
static int dequeueBuffer(ANativeWindow* window, android_native_buffer_t** buffer);
|
||||
static int lockBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
|
||||
static int perform(ANativeWindow* window, int operation, ...);
|
||||
static int query(ANativeWindow* window, int what, int* value);
|
||||
static int query(const ANativeWindow* window, int what, int* value);
|
||||
static int queueBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
|
||||
static int setSwapInterval(ANativeWindow* window, int interval);
|
||||
|
||||
|
@ -57,7 +57,7 @@ private:
|
|||
int dequeueBuffer(android_native_buffer_t** buffer);
|
||||
int lockBuffer(android_native_buffer_t* buffer);
|
||||
int perform(int operation, va_list args);
|
||||
int query(int what, int* value);
|
||||
int query(int what, int* value) const;
|
||||
int queueBuffer(android_native_buffer_t* buffer);
|
||||
int setSwapInterval(int interval);
|
||||
|
||||
|
|
|
@ -206,14 +206,14 @@ private:
|
|||
static int cancelBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
|
||||
static int lockBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
|
||||
static int queueBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
|
||||
static int query(ANativeWindow* window, int what, int* value);
|
||||
static int query(const ANativeWindow* window, int what, int* value);
|
||||
static int perform(ANativeWindow* window, int operation, ...);
|
||||
|
||||
int dequeueBuffer(android_native_buffer_t** buffer);
|
||||
int lockBuffer(android_native_buffer_t* buffer);
|
||||
int queueBuffer(android_native_buffer_t* buffer);
|
||||
int cancelBuffer(android_native_buffer_t* buffer);
|
||||
int query(int what, int* value);
|
||||
int query(int what, int* value) const;
|
||||
int perform(int operation, va_list args);
|
||||
|
||||
void dispatch_setUsage(va_list args);
|
||||
|
|
|
@ -70,7 +70,7 @@ private:
|
|||
static int dequeueBuffer(ANativeWindow* window, android_native_buffer_t** buffer);
|
||||
static int lockBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
|
||||
static int queueBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
|
||||
static int query(ANativeWindow* window, int what, int* value);
|
||||
static int query(const ANativeWindow* window, int what, int* value);
|
||||
static int perform(ANativeWindow* window, int operation, ...);
|
||||
|
||||
framebuffer_device_t* fbDev;
|
||||
|
|
|
@ -249,7 +249,7 @@ struct ANativeWindow
|
|||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*query)(struct ANativeWindow* window,
|
||||
int (*query)(const struct ANativeWindow* window,
|
||||
int what, int* value);
|
||||
|
||||
/*
|
||||
|
|
|
@ -536,9 +536,9 @@ int Surface::queueBuffer(ANativeWindow* window,
|
|||
return self->queueBuffer(buffer);
|
||||
}
|
||||
|
||||
int Surface::query(ANativeWindow* window,
|
||||
int Surface::query(const ANativeWindow* window,
|
||||
int what, int* value) {
|
||||
Surface* self = getSelf(window);
|
||||
const Surface* self = getSelf(window);
|
||||
return self->query(what, value);
|
||||
}
|
||||
|
||||
|
@ -697,7 +697,7 @@ int Surface::queueBuffer(android_native_buffer_t* buffer)
|
|||
return err;
|
||||
}
|
||||
|
||||
int Surface::query(int what, int* value)
|
||||
int Surface::query(int what, int* value) const
|
||||
{
|
||||
switch (what) {
|
||||
case NATIVE_WINDOW_WIDTH:
|
||||
|
|
|
@ -76,8 +76,9 @@ int SurfaceTextureClient::queueBuffer(ANativeWindow* window,
|
|||
return c->queueBuffer(buffer);
|
||||
}
|
||||
|
||||
int SurfaceTextureClient::query(ANativeWindow* window, int what, int* value) {
|
||||
SurfaceTextureClient* c = getSelf(window);
|
||||
int SurfaceTextureClient::query(const ANativeWindow* window,
|
||||
int what, int* value) {
|
||||
const SurfaceTextureClient* c = getSelf(window);
|
||||
return c->query(what, value);
|
||||
}
|
||||
|
||||
|
@ -160,7 +161,7 @@ int SurfaceTextureClient::queueBuffer(android_native_buffer_t* buffer) {
|
|||
return BAD_VALUE;
|
||||
}
|
||||
|
||||
int SurfaceTextureClient::query(int what, int* value) {
|
||||
int SurfaceTextureClient::query(int what, int* value) const {
|
||||
LOGV("SurfaceTextureClient::query");
|
||||
Mutex::Autolock lock(mMutex);
|
||||
switch (what) {
|
||||
|
|
|
@ -270,10 +270,10 @@ int FramebufferNativeWindow::queueBuffer(ANativeWindow* window,
|
|||
return res;
|
||||
}
|
||||
|
||||
int FramebufferNativeWindow::query(ANativeWindow* window,
|
||||
int FramebufferNativeWindow::query(const ANativeWindow* window,
|
||||
int what, int* value)
|
||||
{
|
||||
FramebufferNativeWindow* self = getSelf(window);
|
||||
const FramebufferNativeWindow* self = getSelf(window);
|
||||
Mutex::Autolock _l(self->mutex);
|
||||
framebuffer_device_t* fb = self->fbDev;
|
||||
switch (what) {
|
||||
|
|
Loading…
Reference in New Issue