summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>2011-01-09 23:25:03 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>2011-01-09 23:32:18 +0100
commit5dbc8f9e4907a455cf187574007d34daf414479a (patch)
treec77faa7b2c536067fd63e9093f845ebd06b60e19
parentc6bf87d75456e2ade54acf79beff0d2045466a24 (diff)
downloadframeworks_base-5dbc8f9e4907a455cf187574007d34daf414479a.zip
frameworks_base-5dbc8f9e4907a455cf187574007d34daf414479a.tar.gz
frameworks_base-5dbc8f9e4907a455cf187574007d34daf414479a.tar.bz2
surfaceflinger and libagl: fix bug #11829
The bug #11829 that can be found here: http://code.google.com/p/android/issues/detail?id=11829 causes various graphic artefacts. According to naseer.ahmed it needed modifications in SurfaceFlinger and libagl The modifications comes from: https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=shortlog;h=refs/heads/froyo_almond at commit 33e6506d96d7602284e18ea8c66dbfd04dc72aa3 Change-Id: I703bace69cb7a41ac8ed69ca1e28b98aa618e0f3 Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
-rw-r--r--cmds/surfaceflinger/surfaceflinger/Android.mk17
-rw-r--r--cmds/surfaceflinger/surfaceflinger/main_surfaceflinger.cpp18
-rw-r--r--libs/surfaceflinger/Android.mk12
-rw-r--r--libs/surfaceflinger/Layer.cpp12
-rw-r--r--libs/surfaceflinger/LayerBase.cpp60
-rw-r--r--libs/surfaceflinger/LayerBuffer.cpp14
-rw-r--r--libs/surfaceflinger/LayerDim.cpp13
-rw-r--r--libs/surfaceflinger/SurfaceFlinger.cpp39
-rw-r--r--libs/surfaceflinger/SurfaceFlinger.h11
-rw-r--r--libs/surfaceflinger_client/Android.mk11
-rw-r--r--opengl/libagl/Android.mk3
-rwxr-xr-x[-rw-r--r--]opengl/libagl/copybit.cpp38
-rw-r--r--opengl/libagl/egl.cpp8
13 files changed, 100 insertions, 156 deletions
diff --git a/cmds/surfaceflinger/surfaceflinger/Android.mk b/cmds/surfaceflinger/surfaceflinger/Android.mk
new file mode 100644
index 0000000..69afbdc
--- /dev/null
+++ b/cmds/surfaceflinger/surfaceflinger/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+ main_surfaceflinger.cpp
+
+LOCAL_SHARED_LIBRARIES := \
+ libsurfaceflinger \
+ libbinder \
+ libutils
+
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/../../libs/surfaceflinger
+
+LOCAL_MODULE:= surfaceflinger
+
+include $(BUILD_EXECUTABLE)
diff --git a/cmds/surfaceflinger/surfaceflinger/main_surfaceflinger.cpp b/cmds/surfaceflinger/surfaceflinger/main_surfaceflinger.cpp
new file mode 100644
index 0000000..d650721
--- /dev/null
+++ b/cmds/surfaceflinger/surfaceflinger/main_surfaceflinger.cpp
@@ -0,0 +1,18 @@
+#include <binder/IPCThreadState.h>
+#include <binder/ProcessState.h>
+#include <binder/IServiceManager.h>
+#include <utils/Log.h>
+
+#include <SurfaceFlinger.h>
+
+using namespace android;
+
+int main(int argc, char** argv)
+{
+ sp<ProcessState> proc(ProcessState::self());
+ sp<IServiceManager> sm = defaultServiceManager();
+ LOGI("ServiceManager: %p", sm.get());
+ SurfaceFlinger::instantiate();
+ ProcessState::self()->startThreadPool();
+ IPCThreadState::self()->joinThreadPool();
+}
diff --git a/libs/surfaceflinger/Android.mk b/libs/surfaceflinger/Android.mk
index bef01d8..86eb78d 100644
--- a/libs/surfaceflinger/Android.mk
+++ b/libs/surfaceflinger/Android.mk
@@ -19,6 +19,10 @@ LOCAL_SRC_FILES:= \
LOCAL_CFLAGS:= -DLOG_TAG=\"SurfaceFlinger\"
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+ifeq ($(TARGET_BOARD_PLATFORM), msm7k)
+ LOCAL_CFLAGS += -DDIM_WITH_TEXTURE
+endif
+
# need "-lrt" on Linux simulator to pick up clock_gettime
ifeq ($(TARGET_SIMULATOR),true)
ifeq ($(HOST_OS),linux)
@@ -34,12 +38,8 @@ LOCAL_SHARED_LIBRARIES := \
libEGL \
libGLESv1_CM \
libbinder \
- libui
-
-ifneq ($(BOARD_USES_ECLAIR_LIBCAMERA),true)
- LOCAL_SHARED_LIBRARIES += \
- libsurfaceflinger_client
-endif
+ libui \
+ libsurfaceflinger_client
LOCAL_C_INCLUDES := \
$(call include-path-for, corecg graphics)
diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp
index 2c7b4af..ce7e9aa 100644
--- a/libs/surfaceflinger/Layer.cpp
+++ b/libs/surfaceflinger/Layer.cpp
@@ -133,14 +133,10 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h,
mNeedsBlending = (info.h_alpha - info.l_alpha) > 0;
mNoEGLImageForSwBuffers = !(hwFlags & DisplayHardware::CACHED_BUFFERS);
- if (mFlinger->getUseDithering()) {
- // we use the red index
- int displayRedSize = displayInfo.getSize(PixelFormatInfo::INDEX_RED);
- int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED);
- mNeedsDithering = layerRedsize > displayRedSize;
- } else {
- mNeedsDithering = false;
- }
+ // we use the red index
+ int displayRedSize = displayInfo.getSize(PixelFormatInfo::INDEX_RED);
+ int layerRedsize = info.getSize(PixelFormatInfo::INDEX_RED);
+ mNeedsDithering = layerRedsize > displayRedSize;
for (size_t i=0 ; i<NUM_BUFFERS ; i++) {
mBuffers[i] = new GraphicBuffer();
diff --git a/libs/surfaceflinger/LayerBase.cpp b/libs/surfaceflinger/LayerBase.cpp
index 046c7c3..a8b735e 100644
--- a/libs/surfaceflinger/LayerBase.cpp
+++ b/libs/surfaceflinger/LayerBase.cpp
@@ -33,15 +33,6 @@
#include "SurfaceFlinger.h"
#include "DisplayHardware/DisplayHardware.h"
-#define RENDER_EFFECT_NIGHT 1
-#define RENDER_EFFECT_TERMINAL 2
-#define RENDER_EFFECT_BLUE 3
-#define RENDER_EFFECT_AMBER 4
-#define RENDER_EFFECT_SALMON 5
-#define RENDER_EFFECT_FUSCIA 6
-#define RENDER_EFFECT_N1_CALIBRATED_N 7
-#define RENDER_EFFECT_N1_CALIBRATED_R 8
-#define RENDER_EFFECT_N1_CALIBRATED_C 9
namespace android {
@@ -410,14 +401,7 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
glEnable(GL_TEXTURE_2D);
- int renderEffect = mFlinger->getRenderEffect();
- int renderColorR = mFlinger->getRenderColorR();
- int renderColorG = mFlinger->getRenderColorG();
- int renderColorB = mFlinger->getRenderColorB();
-
- bool noEffect = renderEffect == 0;
-
- if (UNLIKELY(s.alpha < 0xFF) && noEffect) {
+ if (UNLIKELY(s.alpha < 0xFF)) {
// We have an alpha-modulation. We need to modulate all
// texture components by alpha because we're always using
// premultiplied alpha.
@@ -439,7 +423,7 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
glEnable(GL_BLEND);
glBlendFunc(src, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, env);
- } else if (noEffect) {
+ } else {
glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glColor4x(0x10000, 0x10000, 0x10000, 0x10000);
if (needsBlending()) {
@@ -449,44 +433,6 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const
} else {
glDisable(GL_BLEND);
}
- } else {
- // Apply a render effect, which is simple color masks for now.
- GLenum env, src;
- env = GL_MODULATE;
- src = mPremultipliedAlpha ? GL_ONE : GL_SRC_ALPHA;
- const GGLfixed alpha = (s.alpha << 16)/255;
- switch (renderEffect) {
- case RENDER_EFFECT_NIGHT:
- glColor4x(alpha, 0, 0, alpha);
- break;
- case RENDER_EFFECT_TERMINAL:
- glColor4x(0, alpha, 0, alpha);
- break;
- case RENDER_EFFECT_BLUE:
- glColor4x(0, 0, alpha, alpha);
- break;
- case RENDER_EFFECT_AMBER:
- glColor4x(alpha, alpha*0.75, 0, alpha);
- break;
- case RENDER_EFFECT_SALMON:
- glColor4x(alpha, alpha*0.5, alpha*0.5, alpha);
- break;
- case RENDER_EFFECT_FUSCIA:
- glColor4x(alpha, 0, alpha*0.5, alpha);
- break;
- case RENDER_EFFECT_N1_CALIBRATED_N:
- glColor4x(alpha*renderColorR/1000, alpha*renderColorG/1000, alpha*renderColorB/1000, alpha);
- break;
- case RENDER_EFFECT_N1_CALIBRATED_R:
- glColor4x(alpha*(renderColorR-50)/1000, alpha*renderColorG/1000, alpha*(renderColorB-30)/1000, alpha);
- break;
- case RENDER_EFFECT_N1_CALIBRATED_C:
- glColor4x(alpha*renderColorR/1000, alpha*renderColorG/1000, alpha*(renderColorB+30)/1000, alpha);
- break;
- }
- glEnable(GL_BLEND);
- glBlendFunc(src, GL_ONE_MINUS_SRC_ALPHA);
- glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, env);
}
Region::const_iterator it = clip.begin();
@@ -880,4 +826,4 @@ sp<OverlayRef> LayerBaseClient::Surface::createOverlay(
// ---------------------------------------------------------------------------
-}; // namespace android \ No newline at end of file
+}; // namespace android
diff --git a/libs/surfaceflinger/LayerBuffer.cpp b/libs/surfaceflinger/LayerBuffer.cpp
index 0869283..7be3981 100644
--- a/libs/surfaceflinger/LayerBuffer.cpp
+++ b/libs/surfaceflinger/LayerBuffer.cpp
@@ -365,6 +365,14 @@ LayerBuffer::BufferSource::BufferSource(LayerBuffer& layer,
return;
}
+ const DisplayHardware& hw(mLayer.mFlinger->
+ graphicPlane(0).displayHardware());
+ int flags = hw.getFlags();
+ if(flags & DisplayHardware::SLOW_CONFIG)
+ mUseEGLImageDirectly = true;
+ else
+ mUseEGLImageDirectly = false;
+
mBufferHeap = buffers;
mLayer.setNeedsBlending((info.h_alpha - info.l_alpha) > 0);
mBufferSize = info.getScanlineSize(buffers.hor_stride)*buffers.ver_stride;
@@ -474,22 +482,22 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const
// there are constraints on buffers used by the GPU and these may not
// be honored here. We need to change the API so the buffers
// are allocated with gralloc. For now disable this code-path
-#if 0
+
// First, try to use the buffer as an EGLImage directly
if (mUseEGLImageDirectly) {
// NOTE: Assume the buffer is allocated with the proper USAGE flags
sp<GraphicBuffer> buffer = new GraphicBuffer(
- src.img.w, src.img.h, src.img.format,
+ src.crop.r, src.crop.b, src.img.format,
GraphicBuffer::USAGE_HW_TEXTURE,
src.img.w, src.img.handle, false);
+ buffer->setVerticalStride(src.img.h);
err = mLayer.initializeEglImage(buffer, &mTexture);
if (err != NO_ERROR) {
mUseEGLImageDirectly = false;
}
}
-#endif
copybit_device_t* copybit = mLayer.mBlitEngine;
if (copybit && err != NO_ERROR) {
diff --git a/libs/surfaceflinger/LayerDim.cpp b/libs/surfaceflinger/LayerDim.cpp
index 54c5d9f..0825916 100644
--- a/libs/surfaceflinger/LayerDim.cpp
+++ b/libs/surfaceflinger/LayerDim.cpp
@@ -55,6 +55,10 @@ void LayerDim::initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h)
sHeight = h;
sUseTexture = false;
+#if defined(DIM_WITH_TEXTURE) && defined(EGL_ANDROID_image_native_buffer)
+
+#warning "using a texture to implement LayerDim"
+
/* On some h/w like msm7K, it is faster to use a texture because the
* software renderer will defer to copybit, for this to work we need to
* use an EGLImage texture so copybit can actually make use of it.
@@ -64,8 +68,7 @@ void LayerDim::initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h)
const DisplayHardware& hw(flinger->graphicPlane(0).displayHardware());
uint32_t flags = hw.getFlags();
- if (LIKELY((flags & DisplayHardware::DIRECT_TEXTURE) &&
- (flags & DisplayHardware::SLOW_CONFIG))) {
+ if (LIKELY(flags & DisplayHardware::DIRECT_TEXTURE)) {
sp<GraphicBuffer> buffer = new GraphicBuffer(w, h, PIXEL_FORMAT_RGB_565,
GraphicBuffer::USAGE_SW_WRITE_OFTEN |
GraphicBuffer::USAGE_HW_TEXTURE);
@@ -98,6 +101,7 @@ void LayerDim::initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h)
buffer->unlock();
sUseTexture = true;
}
+#endif
}
LayerDim::~LayerDim()
@@ -113,13 +117,13 @@ void LayerDim::onDraw(const Region& clip) const
const DisplayHardware& hw(graphicPlane(0).displayHardware());
const GGLfixed alpha = (s.alpha << 16)/255;
const uint32_t fbHeight = hw.getHeight();
- const uint32_t flags = hw.getFlags();
glDisable(GL_DITHER);
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glColor4x(0, 0, 0, alpha);
- if (sUseTexture && (flags & DisplayHardware::SLOW_CONFIG)) {
+#if defined(DIM_WITH_TEXTURE) && defined(EGL_ANDROID_image_native_buffer)
+ if (sUseTexture) {
glBindTexture(GL_TEXTURE_2D, sTexId);
glEnable(GL_TEXTURE_2D);
glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
@@ -134,6 +138,7 @@ void LayerDim::onDraw(const Region& clip) const
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_SHORT, 0, texCoords);
} else
+#endif
{
glDisable(GL_TEXTURE_2D);
}
diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp
index b9ab1c0..0722fda 100644
--- a/libs/surfaceflinger/SurfaceFlinger.cpp
+++ b/libs/surfaceflinger/SurfaceFlinger.cpp
@@ -184,18 +184,13 @@ SurfaceFlinger::SurfaceFlinger()
mFreezeDisplayTime(0),
mDebugRegion(0),
mDebugBackground(0),
- mRenderEffect(0),
- mRenderColorR(0),
- mRenderColorG(0),
- mRenderColorB(0),
mDebugInSwapBuffers(0),
mLastSwapBufferTime(0),
mDebugInTransaction(0),
mLastTransactionTime(0),
mBootFinished(false),
mConsoleSignals(0),
- mSecureFrameBuffer(0),
- mUseDithering(true)
+ mSecureFrameBuffer(0)
{
init();
}
@@ -210,23 +205,9 @@ void SurfaceFlinger::init()
mDebugRegion = atoi(value);
property_get("debug.sf.showbackground", value, "0");
mDebugBackground = atoi(value);
- property_get("debug.sf.render_effect", value, "0");
- mRenderEffect = atoi(value);
-
- // default calibration color set (disabled by default)
- property_get("debug.sf.render_color_red", value, "975");
- mRenderColorR = atoi(value);
- property_get("debug.sf.render_color_green", value, "937");
- mRenderColorG = atoi(value);
- property_get("debug.sf.render_color_blue", value, "824");
- mRenderColorB = atoi(value);
-
- property_get("persist.sys.use_dithering", value, "0");
- mUseDithering = atoi(value) == 1;
LOGI_IF(mDebugRegion, "showupdates enabled");
LOGI_IF(mDebugBackground, "showbackground enabled");
- LOGI_IF(mUseDithering, "dithering enabled");
}
SurfaceFlinger::~SurfaceFlinger()
@@ -1711,30 +1692,12 @@ status_t SurfaceFlinger::onTransact(
reply->writeInt32(0);
reply->writeInt32(mDebugRegion);
reply->writeInt32(mDebugBackground);
- reply->writeInt32(mRenderEffect);
return NO_ERROR;
case 1013: {
Mutex::Autolock _l(mStateLock);
const DisplayHardware& hw(graphicPlane(0).displayHardware());
reply->writeInt32(hw.getPageFlipCount());
}
- case 1014: { // RENDER_EFFECT
- // TODO: filter to only allow valid effects
- mRenderEffect = data.readInt32();
- return NO_ERROR;
- }
- case 1015: { // RENDER_COLOR_RED
- mRenderColorR = data.readInt32();
- return NO_ERROR;
- }
- case 1016: { // RENDER_COLOR_GREEN
- mRenderColorG = data.readInt32();
- return NO_ERROR;
- }
- case 1017: { // RENDER_COLOR_BLUE
- mRenderColorB = data.readInt32();
- return NO_ERROR;
- }
return NO_ERROR;
}
}
diff --git a/libs/surfaceflinger/SurfaceFlinger.h b/libs/surfaceflinger/SurfaceFlinger.h
index 1bfdb1b..d75dc15 100644
--- a/libs/surfaceflinger/SurfaceFlinger.h
+++ b/libs/surfaceflinger/SurfaceFlinger.h
@@ -174,12 +174,6 @@ public:
overlay_control_device_t* getOverlayEngine() const;
- inline int getRenderEffect() const { return mRenderEffect; }
- inline int getRenderColorR() const { return mRenderColorR; }
- inline int getRenderColorG() const { return mRenderColorG; }
- inline int getRenderColorB() const { return mRenderColorB; }
- inline int getUseDithering() const { return mUseDithering; }
-
status_t removeLayer(const sp<LayerBase>& layer);
status_t addLayer(const sp<LayerBase>& layer);
@@ -360,10 +354,6 @@ private:
// don't use a lock for these, we don't care
int mDebugRegion;
int mDebugBackground;
- int mRenderEffect;
- int mRenderColorR;
- int mRenderColorG;
- int mRenderColorB;
volatile nsecs_t mDebugInSwapBuffers;
nsecs_t mLastSwapBufferTime;
volatile nsecs_t mDebugInTransaction;
@@ -382,7 +372,6 @@ private:
// only written in the main thread, only read in other threads
volatile int32_t mSecureFrameBuffer;
- bool mUseDithering;
};
// ---------------------------------------------------------------------------
diff --git a/libs/surfaceflinger_client/Android.mk b/libs/surfaceflinger_client/Android.mk
index 5368280..fe85b34 100644
--- a/libs/surfaceflinger_client/Android.mk
+++ b/libs/surfaceflinger_client/Android.mk
@@ -10,10 +10,6 @@ LOCAL_SRC_FILES:= \
Surface.cpp \
SurfaceComposerClient.cpp
-LOCAL_MODULE:= libsurfaceflinger_client
-
-ifneq ($(BOARD_USES_ECLAIR_LIBCAMERA),true)
-
LOCAL_SHARED_LIBRARIES := \
libcutils \
libutils \
@@ -21,15 +17,10 @@ LOCAL_SHARED_LIBRARIES := \
libhardware \
libui
+LOCAL_MODULE:= libsurfaceflinger_client
ifeq ($(TARGET_SIMULATOR),true)
LOCAL_LDLIBS += -lpthread
endif
include $(BUILD_SHARED_LIBRARY)
-
-else
-
-include $(BUILD_STATIC_LIBRARY)
-
-endif
diff --git a/opengl/libagl/Android.mk b/opengl/libagl/Android.mk
index 517b5b8..6cb146c 100644
--- a/opengl/libagl/Android.mk
+++ b/opengl/libagl/Android.mk
@@ -44,9 +44,6 @@ ifneq ($(TARGET_SIMULATOR),true)
ifeq ($(TARGET_ARCH)-$(ARCH_ARM_HAVE_TLS_REGISTER),arm-true)
LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER
endif
- ifeq ($(TARGET_HAVE_TEGRA_ERRATA_657451),true)
- LOCAL_CFLAGS += -DHAVE_TEGRA_ERRATA_657451
- endif
LOCAL_C_INCLUDES += bionic/libc/private
endif
diff --git a/opengl/libagl/copybit.cpp b/opengl/libagl/copybit.cpp
index 67d1ce7..f78adca 100644..100755
--- a/opengl/libagl/copybit.cpp
+++ b/opengl/libagl/copybit.cpp
@@ -48,11 +48,24 @@ static void textureToCopyBitImage(
const GGLSurface* surface, int32_t opFormat,
android_native_buffer_t* buffer, copybit_image_t* img)
{
+ uint32_t vstride = 0;
+ if (opFormat == COPYBIT_FORMAT_YCbCr_422_SP ||
+ opFormat == COPYBIT_FORMAT_YCbCr_420_SP ||
+ opFormat == COPYBIT_FORMAT_YCrCb_420_SP) {
+ // NOTE: this static_cast is really not safe b/c we can't know for
+ // sure the buffer passed is of the right type.
+ // However, since we do this only for YUV formats, we should be safe
+ // since only SurfaceFlinger makes use of them.
+ GraphicBuffer* graphicBuffer = static_cast<GraphicBuffer*>(buffer);
+ vstride = graphicBuffer->getVerticalStride();
+ }
+
img->w = surface->stride;
- img->h = surface->height;
+ img->h = vstride ? vstride : surface->height;
img->format = opFormat;
img->base = surface->data;
img->handle = (native_handle_t *)buffer->handle;
+ img->padding = surface->stride - surface->width;
}
struct clipRectRegion : public copybit_region_t {
@@ -87,6 +100,9 @@ static bool supportedCopybitsFormat(int format) {
case COPYBIT_FORMAT_BGRA_8888:
case COPYBIT_FORMAT_RGBA_5551:
case COPYBIT_FORMAT_RGBA_4444:
+ case COPYBIT_FORMAT_YCbCr_422_SP:
+ case COPYBIT_FORMAT_YCbCr_420_SP:
+ case COPYBIT_FORMAT_YCrCb_420_SP:
return true;
default:
return false;
@@ -531,16 +547,16 @@ bool drawTriangleFanWithCopybit_impl(ogles_context_t* c, GLint first, GLsizei co
// at this point, we know we are dealing with a rectangle, so we
// only need to consider 3 vertices for computing the jacobians
- const int dx01 = v1.x - v0.x;
- const int dx02 = v2.x - v0.x;
- const int dy01 = v1.y - v0.y;
- const int dy02 = v2.y - v0.y;
- const int ds01 = t1.S - t0.S;
- const int ds02 = t2.S - t0.S;
- const int dt01 = t1.T - t0.T;
- const int dt02 = t2.T - t0.T;
- const int area = dx01*dy02 - dy01*dx02;
- int dsdx, dsdy, dtdx, dtdy;
+ const long long dx01 = v1.x - v0.x;
+ const long long dx02 = v2.x - v0.x;
+ const long long dy01 = v1.y - v0.y;
+ const long long dy02 = v2.y - v0.y;
+ const long long ds01 = t1.S - t0.S;
+ const long long ds02 = t2.S - t0.S;
+ const long long dt01 = t1.T - t0.T;
+ const long long dt02 = t2.T - t0.T;
+ const long long area = dx01*dy02 - dy01*dx02;
+ long long dsdx, dsdy, dtdx, dtdy;
if (area >= 0) {
dsdx = ds01*dy02 - ds02*dy01;
dtdx = dt01*dy02 - dt02*dy01;
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index e9f60f5..5a9d437 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -2003,11 +2003,7 @@ EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
if (egl_display_t::is_valid(dpy) == EGL_FALSE)
return setError(EGL_BAD_DISPLAY, EGL_FALSE);
// TODO: eglSwapInterval()
- /* TODO: [ahatala 2009-10-09] changing this to default to succeeding,
- as this will cause eglSwapInterval to fail even if the hw implementation
- correctly supports it. */
- //return setError(EGL_BAD_PARAMETER, EGL_FALSE);
- return EGL_TRUE;
+ return setError(EGL_BAD_PARAMETER, EGL_FALSE);
}
// ----------------------------------------------------------------------------
@@ -2105,6 +2101,8 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target,
case HAL_PIXEL_FORMAT_BGRA_8888:
case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_RGBA_4444:
+ case HAL_PIXEL_FORMAT_YCbCr_420_SP:
+ case HAL_PIXEL_FORMAT_YCrCb_420_SP:
break;
default:
return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);