Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: third_party/WebKit/Source/modules/imagebitmap/ImageBitmapModuleTest.cpp

Issue 1387743002: Fixed expando-loss.html test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cache ScriptState and use it to wrap m_defaultVertexArrayObject. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/frame/ImageBitmap.h" 6 #include "core/frame/ImageBitmap.h"
7 7
8 #include "bindings/core/v8/UnionTypesCore.h" 8 #include "bindings/core/v8/UnionTypesCore.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/fetch/MemoryCache.h" 10 #include "core/fetch/MemoryCache.h"
(...skipping 30 matching lines...) Expand all
41 { 41 {
42 RefPtrWillBeRawPtr<HTMLCanvasElement> canvasElement = HTMLCanvasElement::cre ate(*Document::create().get()); 42 RefPtrWillBeRawPtr<HTMLCanvasElement> canvasElement = HTMLCanvasElement::cre ate(*Document::create().get());
43 canvasElement->setHeight(40); 43 canvasElement->setHeight(40);
44 canvasElement->setWidth(40); 44 canvasElement->setWidth(40);
45 RefPtrWillBeRawPtr<ImageBitmap> imageBitmapDerived = nullptr; 45 RefPtrWillBeRawPtr<ImageBitmap> imageBitmapDerived = nullptr;
46 { 46 {
47 RefPtrWillBeRawPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::cre ate(canvasElement.get(), IntRect(0, 0, canvasElement->width(), canvasElement->he ight())); 47 RefPtrWillBeRawPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::cre ate(canvasElement.get(), IntRect(0, 0, canvasElement->width(), canvasElement->he ight()));
48 imageBitmapDerived = ImageBitmap::create(imageBitmapFromCanvas.get(), In tRect(0, 0, 20, 20)); 48 imageBitmapDerived = ImageBitmap::create(imageBitmapFromCanvas.get(), In tRect(0, 0, 20, 20));
49 } 49 }
50 CanvasContextCreationAttributes attributes; 50 CanvasContextCreationAttributes attributes;
51 CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(c anvasElement->getCanvasRenderingContext("2d", attributes)); 51 CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(c anvasElement->getCanvasRenderingContext(nullptr, "2d", attributes));
52 TrackExceptionState exceptionState; 52 TrackExceptionState exceptionState;
53 CanvasImageSourceUnion imageSource; 53 CanvasImageSourceUnion imageSource;
54 imageSource.setImageBitmap(imageBitmapDerived); 54 imageSource.setImageBitmap(imageBitmapDerived);
55 context->drawImage(imageSource, 0, 0, exceptionState); 55 context->drawImage(imageSource, 0, 0, exceptionState);
56 } 56 }
57 57
58 } // namespace 58 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698