X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2FMain%2FFrameBufferAndroid.cpp;h=73409216d034ca021bcbbc648f1fe882b73cc53c;hb=fccddfe6725a1887967a279381567cc40678e888;hp=e574d8285f23dee2bf0c0625febbc2d4bc188ca7;hpb=0e71ea71ed0b411a98039dfd888c4e8ffd45d5b7;p=android-x86%2Fexternal-swiftshader.git diff --git a/src/Main/FrameBufferAndroid.cpp b/src/Main/FrameBufferAndroid.cpp index e574d8285..73409216d 100644 --- a/src/Main/FrameBufferAndroid.cpp +++ b/src/Main/FrameBufferAndroid.cpp @@ -13,6 +13,7 @@ // limitations under the License. #include "FrameBufferAndroid.hpp" +#include "GrallocAndroid.hpp" #include @@ -47,12 +48,8 @@ namespace sw FrameBufferAndroid::FrameBufferAndroid(ANativeWindow* window, int width, int height) : FrameBuffer(width, height, false, false), - nativeWindow(window), buffer(nullptr), gralloc(nullptr) + nativeWindow(window), buffer(nullptr) { - hw_module_t const* pModule; - hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &pModule); - gralloc = reinterpret_cast(pModule); - nativeWindow->common.incRef(&nativeWindow->common); native_window_set_usage(nativeWindow, GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN); } @@ -85,7 +82,7 @@ namespace sw return nullptr; } - if(gralloc->lock(gralloc, buffer->handle, + if(GrallocModule::getInstance()->lock(buffer->handle, GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN, 0, 0, buffer->width, buffer->height, &locked) != 0) { @@ -127,7 +124,7 @@ namespace sw locked = nullptr; - if(gralloc->unlock(gralloc, buffer->handle) != 0) + if(GrallocModule::getInstance()->unlock(buffer->handle) != 0) { ALOGE("%s: badness unlock failed", __FUNCTION__); }