View Javadoc
1   /*
2    * Copyright (c) 2002-2017 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package com.gargoylesoftware.htmlunit.javascript.host.canvas.rendering;
16  
17  import java.io.IOException;
18  
19  import javax.imageio.ImageReader;
20  
21  /**
22   * Simple no-op impl of {@link RenderingBackend}.
23   *
24   * @author Ronald Brill
25   */
26  public class GaeRenderingBackend implements RenderingBackend {
27  
28      /**
29       * Constructor.
30       * @param imageWidth the width
31       * @param imageHeight the height
32       */
33      public GaeRenderingBackend(final int imageWidth, final int imageHeight) {
34      }
35  
36      /**
37       * {@inheritDoc}
38       */
39      @Override
40      public void setFillStyle(final String fillStyle) {
41      }
42  
43      /**
44       * {@inheritDoc}
45       */
46      @Override
47      public void clearRect(final int x, final int y, final int w, final int h) {
48      }
49  
50      /**
51       * {@inheritDoc}
52       */
53      @Override
54      public void fillRect(final int x, final int y, final int w, final int h) {
55      }
56  
57      /**
58       * {@inheritDoc}
59       */
60      @Override
61      public void strokeRect(final int x, final int y, final int w, final int h) {
62      }
63  
64      /**
65       * {@inheritDoc}
66       */
67      @Override
68      public void drawImage(final ImageReader imageReader, final int dxI, final int dyI) throws IOException {
69      }
70  
71      /**
72       * {@inheritDoc}
73       */
74      @Override
75      public byte[] getBytes(final int width, final int height, final int sx, final int sy) {
76          return new byte[width * height * 4];
77      }
78  
79      /**
80       * {@inheritDoc}
81       */
82      @Override
83      public String encodeToString(final String type) throws IOException {
84          return "";
85      }
86  
87  }