01: /*
02: * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
03: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04: *
05: * This code is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU General Public License version 2 only, as
07: * published by the Free Software Foundation. Sun designates this
08: * particular file as subject to the "Classpath" exception as provided
09: * by Sun in the LICENSE file that accompanied this code.
10: *
11: * This code is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * version 2 for more details (a copy is included in the LICENSE file that
15: * accompanied this code).
16: *
17: * You should have received a copy of the GNU General Public License version
18: * 2 along with this work; if not, write to the Free Software Foundation,
19: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22: * CA 95054 USA or visit www.sun.com if you need additional information or
23: * have any questions.
24: */
25:
26: package sun.awt.image;
27:
28: import sun.java2d.SurfaceData;
29:
30: /**
31: * This SurfaceManager variant manages an unaccelerated volatile surface.
32: * This class is created in the event that someone requested a VolatileImage
33: * to be created from a BufferedImageGraphicsConfig, which is not platform-
34: * or hardware-based, thus the resulting surface and surface manager
35: * are unaccelerated. All we do in this class is implement the abstract
36: * methods of VolatileSurfaceManager to return values that indicate that
37: * we cannot accelerate surfaces through this SurfaceManager, thus the
38: * parent class will handle things through the unaccelerated backup mechanism.
39: */
40: public class BufImgVolatileSurfaceManager extends
41: VolatileSurfaceManager {
42:
43: /**
44: * This constructor simply defers to the superclass since all of the real
45: * functionality of this class is implemented in VolatileSurfaceManager.
46: */
47: public BufImgVolatileSurfaceManager(SunVolatileImage vImg,
48: Object context) {
49: super (vImg, context);
50: }
51:
52: /**
53: * Returns false to indicate that this surface manager cannot accelerate
54: * the image.
55: */
56: protected boolean isAccelerationEnabled() {
57: return false;
58: }
59:
60: /**
61: * Returns null to indicate failure in creating the accelerated surface.
62: * Note that this method should not ever be called since creation of
63: * accelerated surfaces should be preceded by calls to the above
64: * isAccelerationEnabled() method. But we need to override this method
65: * since it is abstract in our parent class.
66: */
67: protected SurfaceData initAcceleratedSurface() {
68: return null;
69: }
70: }
|