mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-07 13:39:55 +00:00
fix(libcairo): report native subsurface type
This commit is contained in:
1 parent
cca7deb149
commit
255872d012
2 files changed
+5
-3
No files matched your search
@@ -19,6 +19,7 @@ constexpr int kColor = 0x1000;
|
||||
constexpr int kAlpha = 0x2000;
|
||||
constexpr int kColorAlpha = 0x3000;
|
||||
constexpr int kImageSurfaceType = 0;
|
||||
constexpr int kSubsurfaceType = 23;
|
||||
constexpr int kInvalidFormatValue = -1;
|
||||
|
||||
int BitsPerPixel(int format) {
|
||||
@@ -231,8 +232,9 @@ int APS5_VABI cairo_surface_status(CairoSurface* surface) {
|
||||
return surface ? State(surface)->status : kNullPointer;
|
||||
}
|
||||
|
||||
int APS5_VABI cairo_surface_get_type(CairoSurface*) {
|
||||
return kImageSurfaceType;
|
||||
int APS5_VABI cairo_surface_get_type(CairoSurface* surface) {
|
||||
return surface && State(surface)->status == kSuccess && !State(surface)->isImage
|
||||
? kSubsurfaceType : kImageSurfaceType;
|
||||
}
|
||||
|
||||
int APS5_VABI cairo_surface_get_content(CairoSurface* surface) {
|
||||
|
||||
@@ -185,7 +185,7 @@ void CheckSimilarAndSubsurfaces() {
|
||||
}
|
||||
CairoSurface* subsection = cairo_surface_create_for_rectangle(parent, 1.5, 2.5, 3.5, 4.5);
|
||||
assert(subsection && cairo_surface_status(subsection) == 0);
|
||||
assert(cairo_surface_get_type(subsection) == 0);
|
||||
assert(cairo_surface_get_type(subsection) == 23);
|
||||
assert(cairo_surface_get_content(subsection) == 0x3000);
|
||||
assert(cairo_image_surface_get_format(subsection) == -1);
|
||||
assert(cairo_image_surface_get_data(subsection) == nullptr);
|
||||
|
||||
Reference in new issue
Block a user