Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
frameworks_native
Commits
e647ddde
Commit
e647ddde
authored
10 years ago
by
Dan Stoza
Committed by
Gerrit Code Review
10 years ago
Browse files
Options
Download
Plain Diff
Merge "libgui: Fix CPU rendering on Surface"
parents
ff5c1a6b
c62acbd1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
include/gui/Surface.h
include/gui/Surface.h
+5
-5
libs/gui/Surface.cpp
libs/gui/Surface.cpp
+6
-4
No files found.
include/gui/Surface.h
View file @
e647ddde
...
...
@@ -298,12 +298,12 @@ private:
sp
<
GraphicBuffer
>
mPostedBuffer
;
bool
mConnectedToCpu
;
//
In the lock/unlock context
, this reflects the region that the
producer
// wished to update a
nd
whether the Surface was able to copy
the previous
// buffer back to allow a partial update.
//
When a CPU producer is attached
, this reflects the region that the
//
producer
wished to update a
s well as
whether the Surface was able to copy
//
the previous
buffer back to allow a partial update.
//
//
In the dequeue/queue context
, this reflects the surface damage
(the
//
dama
ge since the
last
frame) passed in by the producer.
//
When a non-CPU producer is attached
, this reflects the surface damage
//
(the chan
ge since the
previous
frame) passed in by the producer.
Region
mDirtyRegion
;
};
...
...
This diff is collapsed.
Click to expand it.
libs/gui/Surface.cpp
View file @
e647ddde
...
...
@@ -322,7 +322,7 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) {
mDataSpace
,
crop
,
mScalingMode
,
mTransform
^
mStickyTransform
,
mSwapIntervalZero
,
fence
,
mStickyTransform
);
if
(
mDirtyRegion
.
bounds
()
==
Rect
::
INVALID_RECT
)
{
if
(
mConnectedToCpu
||
mDirtyRegion
.
bounds
()
==
Rect
::
INVALID_RECT
)
{
input
.
setSurfaceDamage
(
Region
::
INVALID_REGION
);
}
else
{
// The surface damage was specified using the OpenGL ES convention of
...
...
@@ -356,8 +356,10 @@ int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) {
mConsumerRunningBehind
=
(
numPendingBuffers
>=
2
);
// Clear surface damage back to full-buffer
mDirtyRegion
=
Region
::
INVALID_REGION
;
if
(
!
mConnectedToCpu
)
{
// Clear surface damage back to full-buffer
mDirtyRegion
=
Region
::
INVALID_REGION
;
}
return
err
;
}
...
...
@@ -844,7 +846,7 @@ void Surface::setSurfaceDamage(android_native_rect_t* rects, size_t numRects) {
ALOGV
(
"Surface::setSurfaceDamage"
);
Mutex
::
Autolock
lock
(
mMutex
);
if
(
numRects
==
0
)
{
if
(
mConnectedToCpu
||
numRects
==
0
)
{
mDirtyRegion
=
Region
::
INVALID_REGION
;
return
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment