1139
1140 if (blit) {
1141 blitSurfaceData(oldData, getSurfaceData());
1142 }
1143
1144 if (oldData != null && oldData != getSurfaceData()) {
1145 // TODO: drop oldData for D3D/WGL pipelines
1146 // This can only happen when this peer is being created
1147 oldData.flush();
1148 }
1149 }
1150 flushOnscreenGraphics();
1151 }
1152
1153 private void blitSurfaceData(final SurfaceData src, final SurfaceData dst) {
1154 //TODO blit. proof-of-concept
1155 if (src != dst && src != null && dst != null
1156 && !(dst instanceof NullSurfaceData)
1157 && !(src instanceof NullSurfaceData)
1158 && src.getSurfaceType().equals(dst.getSurfaceType())
1159 && src.getDefaultScale() == dst.getDefaultScale()) {
1160 final Rectangle size = src.getBounds();
1161 final Blit blit = Blit.locate(src.getSurfaceType(),
1162 CompositeType.Src,
1163 dst.getSurfaceType());
1164 if (blit != null) {
1165 blit.Blit(src, dst, AlphaComposite.Src, null, 0, 0, 0, 0,
1166 size.width, size.height);
1167 }
1168 }
1169 }
1170
1171 /**
1172 * Request the window insets from the delegate and compares it with the
1173 * current one. This method is mostly called by the delegate, e.g. when the
1174 * window state is changed and insets should be recalculated.
1175 * <p/>
1176 * This method may be called on the toolkit thread.
1177 */
1178 public final boolean updateInsets(final Insets newInsets) {
1179 synchronized (getStateLock()) {
|
1139
1140 if (blit) {
1141 blitSurfaceData(oldData, getSurfaceData());
1142 }
1143
1144 if (oldData != null && oldData != getSurfaceData()) {
1145 // TODO: drop oldData for D3D/WGL pipelines
1146 // This can only happen when this peer is being created
1147 oldData.flush();
1148 }
1149 }
1150 flushOnscreenGraphics();
1151 }
1152
1153 private void blitSurfaceData(final SurfaceData src, final SurfaceData dst) {
1154 //TODO blit. proof-of-concept
1155 if (src != dst && src != null && dst != null
1156 && !(dst instanceof NullSurfaceData)
1157 && !(src instanceof NullSurfaceData)
1158 && src.getSurfaceType().equals(dst.getSurfaceType())
1159 && src.getDefaultScaleX() == dst.getDefaultScaleX()
1160 && src.getDefaultScaleY() == dst.getDefaultScaleY())
1161 {
1162 final Rectangle size = src.getBounds();
1163 final Blit blit = Blit.locate(src.getSurfaceType(),
1164 CompositeType.Src,
1165 dst.getSurfaceType());
1166 if (blit != null) {
1167 blit.Blit(src, dst, AlphaComposite.Src, null, 0, 0, 0, 0,
1168 size.width, size.height);
1169 }
1170 }
1171 }
1172
1173 /**
1174 * Request the window insets from the delegate and compares it with the
1175 * current one. This method is mostly called by the delegate, e.g. when the
1176 * window state is changed and insets should be recalculated.
1177 * <p/>
1178 * This method may be called on the toolkit thread.
1179 */
1180 public final boolean updateInsets(final Insets newInsets) {
1181 synchronized (getStateLock()) {
|