/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "D3DPipeline.h"
#include <malloc.h>
#include "sun_java2d_pipe_BufferedOpCodes.h"
#include "jlong.h"
#include "D3DBlitLoops.h"
#include "D3DBufImgOps.h"
#include "D3DPipelineManager.h"
#include "D3DContext.h"
#include "D3DMaskBlit.h"
#include "D3DMaskFill.h"
#include "D3DPaints.h"
#include "D3DRenderQueue.h"
#include "D3DRenderer.h"
#include "D3DSurfaceData.h"
#include "D3DTextRenderer.h"
#include "Trace.h"
#include "awt_Toolkit.h"
/**
* References to the "current" context and destination surface.
*/
typedef struct {
int limit;
{
// flush the current vertex queue here, just in case
}
// end scene for this destination
// This is a workaround for what apparently is a DWM bug.
// If the dimensions of the back-buffer don't match the dimensions of
// the window, Present() will flash the whole window with black.
// The workaround is to detect this situation and not do a present.
// It is ok to do so since a repaint event is coming due to the resize that
// just happened.
//
// REMIND: this will need to be updated if we switch to creating
// back-buffers of the size of the client area instead of the whole window
// (use GetClientRect() instead of GetWindowRect()).
if (DWMIsCompositionEnabled()) {
RECT r;
"win: w=%d h=%d, bb: w=%d h=%d",
return S_OK;
}
}
// nothing to present
return S_OK;
}
// only offset in windowed mode
} else {
// some boards (Nvidia) have problems with copy strategy and
// means that we'll paint over fs window decorations
}
} else {
} else {
}
}
return res;
}
{
bLostDevices = TRUE;
// only mark surfaces belonging to the lost device
{
if (pd3dDevice) {
// this surface's device is not lost, do not mark it
return res;
}
}
}
}
return res;
}
{
unsigned char *b, *end;
int limit;
return;
}
if (bLostDevices) {
}
}
while (b < end) {
switch (opcode) {
// draw ops
{
}
break;
{
}
break;
{
}
break;
{
}
break;
{
}
break;
{
}
break;
{
}
break;
// fill ops
{
}
break;
{
}
break;
{
}
break;
{
}
break;
// text-related ops
{
unsigned char *images = b;
unsigned char *positions;
if (usePositions) {
} else {
}
}
break;
// copy-related ops
{
}
break;
{
if (isoblit) {
} else {
}
}
break;
{
}
break;
{
SKIP_BYTES(b, masklen);
}
break;
{
SKIP_BYTES(b, masklen);
}
break;
// state-related ops
{
}
break;
{
}
break;
{
}
break;
{
}
break;
{
}
break;
{
}
break;
{
// res = d3dc->SetXorComposite(d3dc, xorPixel);
}
break;
{
}
break;
{
}
break;
{
}
break;
// context-related ops
{
}
"D3DRQ_FlushBuffer: failed to get context");
break;
}
// REMIND: we may also want to do EndScene on each
// render target change so that the GPU can go work on
// whatever is already in the queue
}
}
break;
{
}
"D3DRQ_FlushBuffer: failed to get context");
}
}
break;
{
}
}
break;
{
}
}
break;
{
// REMIND: does this need to be implemented for D3D?
}
break;
{
// flush just in case there are any pending operations in
// the hardware pipe
}
// invalidate the references to the current context and
// destination surface that are maintained at the native level
}
break;
{
}
break;
{
} else {
bLostDevices = TRUE;
}
}
break;
{
}
break;
{
}
break;
// multibuffering ops
{
}
break;
// special no-op (mainly used for achieving 8-byte alignment)
break;
// paint-related ops
{
}
break;
{
}
break;
{
}
break;
{
}
break;
{
}
break;
{
}
break;
// BufferedImageOp-related ops
{
kernelWidth, kernelHeight, b);
}
break;
{
}
break;
{
unsigned char *scaleFactors = b;
}
break;
{
}
break;
{
void *tableValues = b;
}
break;
{
}
break;
default:
"D3DRQ_flushBuffer: invalid opcode=%d", opcode);
return;
}
// we may mark the surface lost repeatedly but that won't do much harm
}
// REMIND: EndScene is not really enough to flush the
// whole d3d pipeline
// REMIND: there may be an issue with BeginScene/EndScene
// for each flushQueue, because of the blits, which flush
// the queue
if (bSync) {
}
}
// REMIND: we need to also handle hard errors here as well, and disable
// particular context if needed
}
}
/**
* Returns a pointer to the "current" context, as set by the last SET_SURFACES
* or SET_SCRATCH_SURFACE operation.
*/
{
return d3dc;
}
/**
* Returns a pointer to the "current" destination surface, as set by the last
* SET_SURFACES operation.
*/
D3DSDOps *
{
return dstOps;
}
/**
* Resets current context and destination surface.
*/
void
{
}
extern "C"
{
/*
* Class: sun_java2d_d3d_D3DRenderQueue
* Method: flushBuffer
*/
{
// just in case we forget to init any new fields
"D3DRenderQueue_flushBuffer: cannot get direct buffer address");
return;
}
}
}
}