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

Side by Side Diff: src/core/SkDraw.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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
« no previous file with comments | « src/core/SkDeviceProfile.cpp ('k') | src/core/SkError.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #define __STDC_LIMIT_MACROS 7 #define __STDC_LIMIT_MACROS
8 8
9 #include "SkDraw.h" 9 #include "SkDraw.h"
10 #include "SkBlitter.h" 10 #include "SkBlitter.h"
(...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 typedef SkShader::Context INHERITED; 1912 typedef SkShader::Context INHERITED;
1913 }; 1913 };
1914 1914
1915 SK_TO_STRING_OVERRIDE() 1915 SK_TO_STRING_OVERRIDE()
1916 1916
1917 // For serialization. This will never be called. 1917 // For serialization. This will never be called.
1918 Factory getFactory() const override { sk_throw(); return NULL; } 1918 Factory getFactory() const override { sk_throw(); return NULL; }
1919 1919
1920 protected: 1920 protected:
1921 Context* onCreateContext(const ContextRec& rec, void* storage) const overrid e { 1921 Context* onCreateContext(const ContextRec& rec, void* storage) const overrid e {
1922 return SkNEW_PLACEMENT_ARGS(storage, TriColorShaderContext, (*this, rec) ); 1922 return new (storage) TriColorShaderContext(*this, rec);
1923 } 1923 }
1924 1924
1925 private: 1925 private:
1926 typedef SkShader INHERITED; 1926 typedef SkShader INHERITED;
1927 }; 1927 };
1928 1928
1929 bool SkTriColorShader::TriColorShaderContext::setup(const SkPoint pts[], const S kColor colors[], 1929 bool SkTriColorShader::TriColorShaderContext::setup(const SkPoint pts[], const S kColor colors[],
1930 int index0, int index1, int index2) { 1930 int index0, int index1, int index2) {
1931 1931
1932 fColors[0] = SkPreMultiplyColor(colors[index0]); 1932 fColors[0] = SkPreMultiplyColor(colors[index0]);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 // just colors (no texture) 2069 // just colors (no texture)
2070 shader = p.setShader(&triShader); 2070 shader = p.setShader(&triShader);
2071 } else { 2071 } else {
2072 // colors * texture 2072 // colors * texture
2073 SkASSERT(shader); 2073 SkASSERT(shader);
2074 bool releaseMode = false; 2074 bool releaseMode = false;
2075 if (NULL == xmode) { 2075 if (NULL == xmode) {
2076 xmode = SkXfermode::Create(SkXfermode::kModulate_Mode); 2076 xmode = SkXfermode::Create(SkXfermode::kModulate_Mode);
2077 releaseMode = true; 2077 releaseMode = true;
2078 } 2078 }
2079 composeShader.reset(SkNEW_ARGS(SkComposeShader, (&triShader, shader, xmode))); 2079 composeShader.reset(new SkComposeShader(&triShader, shader, xmode));
2080 p.setShader(composeShader); 2080 p.setShader(composeShader);
2081 if (releaseMode) { 2081 if (releaseMode) {
2082 xmode->unref(); 2082 xmode->unref();
2083 } 2083 }
2084 } 2084 }
2085 } 2085 }
2086 2086
2087 SkAutoBlitterChoose blitter(fDst, *fMatrix, p); 2087 SkAutoBlitterChoose blitter(fDst, *fMatrix, p);
2088 // Abort early if we failed to create a shader context. 2088 // Abort early if we failed to create a shader context.
2089 if (blitter->isNullBlitter()) { 2089 if (blitter->isNullBlitter()) {
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
2260 mask->fImage = SkMask::AllocImage(size); 2260 mask->fImage = SkMask::AllocImage(size);
2261 memset(mask->fImage, 0, mask->computeImageSize()); 2261 memset(mask->fImage, 0, mask->computeImageSize());
2262 } 2262 }
2263 2263
2264 if (SkMask::kJustComputeBounds_CreateMode != mode) { 2264 if (SkMask::kJustComputeBounds_CreateMode != mode) {
2265 draw_into_mask(*mask, devPath, style); 2265 draw_into_mask(*mask, devPath, style);
2266 } 2266 }
2267 2267
2268 return true; 2268 return true;
2269 } 2269 }
OLDNEW
« no previous file with comments | « src/core/SkDeviceProfile.cpp ('k') | src/core/SkError.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698