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

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

Issue 270473003: Make gMask_00FF00FF a constant (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: const mask no-static Created 6 years, 7 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/SkBlitMask_D32.cpp ('k') | src/opts/SkColor_opts_SSE2.h » ('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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkBlitter.h" 10 #include "SkBlitter.h"
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 // innerBlitter was allocated by allocator, which will delete it. 989 // innerBlitter was allocated by allocator, which will delete it.
990 // We know shaderContext is of type Sk3DShaderContext because it belongs to shader3D. 990 // We know shaderContext is of type Sk3DShaderContext because it belongs to shader3D.
991 blitter = allocator->createT<Sk3DBlitter>(innerBlitter, 991 blitter = allocator->createT<Sk3DBlitter>(innerBlitter,
992 static_cast<Sk3DShader::Sk3DShaderContext*>(shaderContext)); 992 static_cast<Sk3DShader::Sk3DShaderContext*>(shaderContext));
993 } 993 }
994 return blitter; 994 return blitter;
995 } 995 }
996 996
997 /////////////////////////////////////////////////////////////////////////////// 997 ///////////////////////////////////////////////////////////////////////////////
998 998
999 const uint16_t gMask_0F0F = 0xF0F;
1000 const uint32_t gMask_00FF00FF = 0xFF00FF;
1001
1002 ///////////////////////////////////////////////////////////////////////////////
1003
1004 class SkTransparentShaderContext : public SkShader::Context { 999 class SkTransparentShaderContext : public SkShader::Context {
1005 public: 1000 public:
1006 SkTransparentShaderContext(const SkShader& shader, const SkShader::ContextRe c& rec) 1001 SkTransparentShaderContext(const SkShader& shader, const SkShader::ContextRe c& rec)
1007 : INHERITED(shader, rec) {} 1002 : INHERITED(shader, rec) {}
1008 1003
1009 virtual void shadeSpan(int x, int y, SkPMColor colors[], int count) SK_OVERR IDE { 1004 virtual void shadeSpan(int x, int y, SkPMColor colors[], int count) SK_OVERR IDE {
1010 sk_bzero(colors, count * sizeof(SkPMColor)); 1005 sk_bzero(colors, count * sizeof(SkPMColor));
1011 } 1006 }
1012 1007
1013 private: 1008 private:
(...skipping 27 matching lines...) Expand all
1041 // shader to create it. It is therefore safe to re-use the storage. 1036 // shader to create it. It is therefore safe to re-use the storage.
1042 fShaderContext->~Context(); 1037 fShaderContext->~Context();
1043 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext); 1038 SkShader::Context* ctx = fShader->createContext(rec, (void*)fShaderContext);
1044 if (NULL == ctx) { 1039 if (NULL == ctx) {
1045 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call 1040 // Need a valid context in fShaderContext's storage, so we can later (or our caller) call
1046 // the in-place destructor. 1041 // the in-place destructor.
1047 SkNEW_PLACEMENT_ARGS(fShaderContext, SkTransparentShaderContext, (*fShad er, rec)); 1042 SkNEW_PLACEMENT_ARGS(fShaderContext, SkTransparentShaderContext, (*fShad er, rec));
1048 } 1043 }
1049 return ctx != NULL; 1044 return ctx != NULL;
1050 } 1045 }
OLDNEW
« no previous file with comments | « src/core/SkBlitMask_D32.cpp ('k') | src/opts/SkColor_opts_SSE2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698