Lines Matching full:region
17 #define LOG_TAG "Region"
26 #include <ui/Region.h>
57 Region::Region() {
61 Region::Region(const Region& rhs)
69 Region::Region(const Rect& rhs) {
73 Region::~Region()
88 * final, correctly ordered region buffer. Each rectangle will be compared with the span directly
179 * Creates a new region with the same data as the argument, but divides rectangles as necessary to
182 * Note: the output will not necessarily be a very efficient representation of the region, since it
185 Region Region::createTJunctionFreeRegion(const Region& r) {
192 Region outputRegion;
195 outputRegion.mStorage.add(r.getBounds()); // to make region valid, mStorage must end with bounds
198 validate(outputRegion, "T-Junction free region");
204 Region& Region::operator = (const Region& rhs)
214 Region& Region::makeBoundsSelf()
224 void Region::clear()
230 void Region::set(const Rect& r)
236 void Region::set(uint32_t w, uint32_t h)
242 bool Region::isTriviallyEqual(const Region& region) const {
243 return begin() == region.begin();
248 void Region::addRectUnchecked(int l, int t, int r, int b)
257 Region& Region::orSelf(const Rect& r) {
260 Region& Region::xorSelf(const Rect& r) {
263 Region& Region::andSelf(const Rect& r) {
266 Region& Region::subtractSelf(const Rect& r) {
269 Region& Region::operationSelf(const Rect& r, int op) {
270 Region lhs(*this);
277 Region& Region::orSelf(const Region& rhs) {
280 Region& Region::xorSelf(const Region& rhs) {
283 Region& Region::andSelf(const Region& rhs) {
286 Region& Region::subtractSelf(const Region& rhs) {
289 Region& Region::operationSelf(const Region& rhs, int op) {
290 Region lhs(*this);
295 Region& Region::translateSelf(int x, int y) {
302 const Region Region::merge(const Rect& rhs) const {
305 const Region Region::mergeExclusive(const Rect& rhs) const {
308 const Region Region::intersect(const Rect& rhs) const {
311 const Region Region::subtract(const Rect& rhs) const {
314 const Region Region::operation(const Rect& rhs, int op) const {
315 Region result;
322 const Region Region::merge(const Region& rhs) const {
325 const Region Region::mergeExclusive(const Region& rhs) const {
328 const Region Region::intersect(const Region& rhs) const {
331 const Region Region::subtract(const Region& rhs) const {
334 const Region Region::operation(const Region& rhs, int op) const {
335 Region result;
340 const Region Region::translate(int x, int y) const {
341 Region result;
348 Region& Region::orSelf(const Region& rhs, int dx, int dy) {
351 Region& Region::xorSelf(const Region& rhs, int dx, int dy) {
354 Region& Region::andSelf(const Region& rhs, int dx, int dy) {
357 Region& Region::subtractSelf(const Region& rhs, int dx, int dy) {
360 Region& Region::operationSelf(const Region& rhs, int dx, int dy, int op) {
361 Region lhs(*this);
368 const Region Region::merge(const Region& rhs, int dx, int dy) const {
371 const Region Region::mergeExclusive(const Region& rhs, int dx, int dy) const {
374 const Region Region::intersect(const Region& rhs, int dx, int dy) const {
377 const Region Region::subtract(const Region& rhs, int dx, int dy) const {
380 const Region Region::operation(const Region& rhs, int dx, int dy, int op) const {
381 Region result;
388 // This is our region rasterizer, which merges rects and spans together
389 // to obtain an optimal region.
390 class Region::rasterizer : public region_operator<Rect>::region_rasterizer
399 rasterizer(Region& reg)
474 bool Region::validate(const Region& reg, const char* name, bool silent)
483 ALOGE_IF(!silent, "%s: region contains an invalid Rect", name);
500 ALOGE_IF(!silent, "%s: region's Rects not sorted", name);
542 void Region::boolean_operation(int op, Region& dst,
543 const Region& lhs,
544 const Region& rhs, int dx, int dy)
558 region_operator<Rect>::region lhs_region(lhs_rects, lhs_count);
559 region_operator<Rect>::region rhs_region(rhs_rects, rhs_count, dx, dy);
607 Region::const_iterator head = dst.begin();
608 Region::const_iterator const tail = dst.end();
652 void Region::boolean_operation(int op, Region& dst,
653 const Region& lhs,
657 ALOGE("Region::boolean_operation(op=%d) invalid Rect={%d,%d,%d,%d}",
663 boolean_operation(op, dst, lhs, Region(rhs), dx, dy);
668 region_operator<Rect>::region lhs_region(lhs_rects, lhs_count);
669 region_operator<Rect>::region rhs_region(&rhs, 1, dx, dy);
679 void Region::boolean_operation(int op, Region& dst,
680 const Region& lhs, const Region& rhs)
685 void Region::boolean_operation(int op, Region& dst,
686 const Region& lhs, const Rect& rhs)
691 void Region::translate(Region& reg, int dx, int dy)
710 void Region::translate(Region& dst, const Region& reg, int dx, int dy)
718 size_t Region::getSize() const {
722 status_t Region::flatten(void* buffer) const {
724 validate(*this, "Region::flatten");
731 status_t Region::unflatten(void const* buffer, size_t size) {
732 Region result;
746 validate(result, "Region::unflatten");
749 if (!result.validate(result, "Region::unflatten", true)) {
750 ALOGE("Region::unflatten() failed, invalid region");
759 Region::const_iterator Region::begin() const {
763 Region::const_iterator Region::end() const {
768 Rect const* Region::getArray(size_t* count) const {
775 SharedBuffer const* Region::getSharedBuffer(size_t* count) const {
789 void Region::dump(String8& out, const char* what, uint32_t flags) const
798 snprintf(buffer, SIZE, " Region %s (this=%p, count=%d)\n",
809 void Region::dump(const char* what, uint32_t flags) const
814 ALOGD(" Region %s (this=%p, count=%d)\n", what, this, tail-head);