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

Side by Side Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 1001703003: Take NativeImageSkia out behind the woodshed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Switch to skia-style API (return bool instead of SkBitmap) Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/ImageBitmapTest.cpp ('k') | Source/core/imagebitmap/ImageBitmapFactories.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 return false; 89 return false;
90 return true; 90 return true;
91 } 91 }
92 92
93 PassRefPtr<Image> createTransparentImage(const IntSize& size) 93 PassRefPtr<Image> createTransparentImage(const IntSize& size)
94 { 94 {
95 ASSERT(canCreateImageBuffer(size)); 95 ASSERT(canCreateImageBuffer(size));
96 SkBitmap bitmap; 96 SkBitmap bitmap;
97 bitmap.allocN32Pixels(size.width(), size.height()); 97 bitmap.allocN32Pixels(size.width(), size.height());
98 bitmap.eraseColor(SK_ColorTRANSPARENT); 98 bitmap.eraseColor(SK_ColorTRANSPARENT);
99 return BitmapImage::create(NativeImageSkia::create(bitmap)); 99 return BitmapImage::create(bitmap);
100 } 100 }
101 101
102 } // namespace 102 } // namespace
103 103
104 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(CanvasObserver); 104 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(CanvasObserver);
105 105
106 inline HTMLCanvasElement::HTMLCanvasElement(Document& document) 106 inline HTMLCanvasElement::HTMLCanvasElement(Document& document)
107 : HTMLElement(canvasTag, document) 107 : HTMLElement(canvasTag, document)
108 , DocumentVisibilityObserver(document) 108 , DocumentVisibilityObserver(document)
109 , m_size(DefaultWidth, DefaultHeight) 109 , m_size(DefaultWidth, DefaultHeight)
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 { 892 {
893 return FloatSize(width(), height()); 893 return FloatSize(width(), height());
894 } 894 }
895 895
896 bool HTMLCanvasElement::isOpaque() const 896 bool HTMLCanvasElement::isOpaque() const
897 { 897 {
898 return m_context && !m_context->hasAlpha(); 898 return m_context && !m_context->hasAlpha();
899 } 899 }
900 900
901 } // blink 901 } // blink
OLDNEW
« no previous file with comments | « Source/core/frame/ImageBitmapTest.cpp ('k') | Source/core/imagebitmap/ImageBitmapFactories.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698