| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 { | 195 { |
| 196 RefPtr<HTMLCanvasElement> canvasElement = HTMLCanvasElement::create(*Documen
t::create().get()); | 196 RefPtr<HTMLCanvasElement> canvasElement = HTMLCanvasElement::create(*Documen
t::create().get()); |
| 197 canvasElement->setHeight(40); | 197 canvasElement->setHeight(40); |
| 198 canvasElement->setWidth(40); | 198 canvasElement->setWidth(40); |
| 199 RefPtr<ImageBitmap> imageBitmapDerived; | 199 RefPtr<ImageBitmap> imageBitmapDerived; |
| 200 { | 200 { |
| 201 RefPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::create(canvasEl
ement.get(), IntRect(0, 0, canvasElement->width(), canvasElement->height())); | 201 RefPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::create(canvasEl
ement.get(), IntRect(0, 0, canvasElement->width(), canvasElement->height())); |
| 202 imageBitmapDerived = ImageBitmap::create(imageBitmapFromCanvas.get(), In
tRect(0, 0, 20, 20)); | 202 imageBitmapDerived = ImageBitmap::create(imageBitmapFromCanvas.get(), In
tRect(0, 0, 20, 20)); |
| 203 } | 203 } |
| 204 CanvasRenderingContext* context = canvasElement->getContext("2d"); | 204 CanvasRenderingContext* context = canvasElement->getContext("2d"); |
| 205 TrackExceptionState es; | 205 TrackExceptionState exceptionState; |
| 206 static_cast<CanvasRenderingContext2D*>(context)->drawImage(imageBitmapDerive
d.get(), 0, 0, es); | 206 static_cast<CanvasRenderingContext2D*>(context)->drawImage(imageBitmapDerive
d.get(), 0, 0, exceptionState); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace | 209 } // namespace |
| OLD | NEW |