summaryrefslogtreecommitdiff
path: root/libs/hwui/renderstate/Scissor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderstate/Scissor.cpp')
-rw-r--r--libs/hwui/renderstate/Scissor.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/libs/hwui/renderstate/Scissor.cpp b/libs/hwui/renderstate/Scissor.cpp
index 61dd8c3200a4..e37ed029542b 100644
--- a/libs/hwui/renderstate/Scissor.cpp
+++ b/libs/hwui/renderstate/Scissor.cpp
@@ -23,12 +23,7 @@ namespace android {
namespace uirenderer {
Scissor::Scissor()
- : mEnabled(false)
- , mScissorX(0)
- , mScissorY(0)
- , mScissorWidth(0)
- , mScissorHeight(0) {
-}
+ : mEnabled(false), mScissorX(0), mScissorY(0), mScissorWidth(0), mScissorHeight(0) {}
bool Scissor::setEnabled(bool enabled) {
if (mEnabled != enabled) {
@@ -44,9 +39,8 @@ bool Scissor::setEnabled(bool enabled) {
}
bool Scissor::set(GLint x, GLint y, GLint width, GLint height) {
- if (mEnabled && (x != mScissorX || y != mScissorY
- || width != mScissorWidth || height != mScissorHeight)) {
-
+ if (mEnabled &&
+ (x != mScissorX || y != mScissorY || width != mScissorWidth || height != mScissorHeight)) {
if (x < 0) {
width += x;
x = 0;
@@ -80,10 +74,7 @@ void Scissor::set(int viewportHeight, const Rect& clip) {
GLint width = std::max(0, ((int)clip.right) - x);
GLint height = std::max(0, (viewportHeight - (int)clip.top) - y);
- if (x != mScissorX
- || y != mScissorY
- || width != mScissorWidth
- || height != mScissorHeight) {
+ if (x != mScissorX || y != mScissorY || width != mScissorWidth || height != mScissorHeight) {
glScissor(x, y, width, height);
mScissorX = x;
@@ -104,10 +95,9 @@ void Scissor::invalidate() {
}
void Scissor::dump() {
- ALOGD("Scissor: enabled %d, %d %d %d %d",
- mEnabled, mScissorX, mScissorY, mScissorWidth, mScissorHeight);
+ ALOGD("Scissor: enabled %d, %d %d %d %d", mEnabled, mScissorX, mScissorY, mScissorWidth,
+ mScissorHeight);
}
} /* namespace uirenderer */
} /* namespace android */
-