Closed
Bug 561678
Opened 15 years ago
Closed 4 years ago
Make ThebesLayerOGL use platform-optimal drawing surface
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: bas.schouten, Assigned: bas.schouten)
Details
Attachments
(1 file, 1 obsolete file)
5.02 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
BeginDraw should return a surface type that works best on that platform for drawing to. The easiest way to do that is to use CreateOffscreenSurface, and then do uploading to GL in a surface type dependent way.
Attachment #441413 -
Flags: review?(roc)
Assignee | ||
Comment 1•15 years ago
|
||
Corrected to use OPERATOR_SOURCE. This should perform faster better.
Attachment #441413 -
Attachment is obsolete: true
Attachment #441414 -
Flags: review?(roc)
Attachment #441413 -
Flags: review?(roc)
Comment on attachment 441414 [details] [diff] [review]
Use Native Surface in ThebesLayerOGL v2
- mSoftwareSurface = new gfxImageSurface(gfxIntSize(mInvalidatedRect.width,
- mInvalidatedRect.height),
- gfxASurface::ImageFormatRGB24);
+ mDestinationSurface =
+ gfxPlatform::GetPlatform()->
+ CreateOffscreenSurface(gfxIntSize(mInvalidatedRect.width,
+ mInvalidatedRect.height),
+ gfxASurface::ImageFormatRGB24);
} else {
- mSoftwareSurface = new gfxImageSurface(gfxIntSize(mInvalidatedRect.width,
- mInvalidatedRect.height),
- gfxASurface::ImageFormatARGB32);
+ mDestinationSurface =
+ gfxPlatform::GetPlatform()->
+ CreateOffscreenSurface(gfxIntSize(mInvalidatedRect.width,
+ mInvalidatedRect.height),
+ gfxASurface::ImageFormatARGB32);
Better to just have one call to CreateOffscreenSurface with a variable format
+ {
+ imageSurface = new gfxImageSurface(gfxIntSize(mInvalidatedRect.width,
+ mInvalidatedRect.height),
+ imageFormat);
+ nsRefPtr<gfxContext> tmpContext = new gfxContext(imageSurface);
+ tmpContext->SetSource(mDestinationSurface);
+ tmpContext->SetOperator(gfxContext::OPERATOR_SOURCE);
+ tmpContext->Paint();
+ }
Still quite suboptimal for non-Windows ... Probably should add a comment that you really, really don't want to be taking this default path.
Attachment #441414 -
Flags: review?(roc) → review+
+ case gfxASurface::SurfaceTypeWin32Printing:
+ imageSurface =
+ static_cast<gfxWindowsSurface*>(mDestinationSurface.get())->
+ GetImageSurface();
Is it really true that for a Win32Printing surface we can get the image bits like this?
Assignee | ||
Updated•4 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•