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

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

Issue 1768433003: remove align16 calls in skhader context sizes. will handle this elsewhere as needed (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | src/core/SkSmallAllocator.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 * 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 7
8 #include "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkBitmapProcShader.h" 9 #include "SkBitmapProcShader.h"
10 #include "SkColorShader.h" 10 #include "SkColorShader.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 colorPtr = &storage; 79 colorPtr = &storage;
80 } 80 }
81 if (this->onAsLuminanceColor(colorPtr)) { 81 if (this->onAsLuminanceColor(colorPtr)) {
82 *colorPtr = SkColorSetA(*colorPtr, 0xFF); // we only return opaque 82 *colorPtr = SkColorSetA(*colorPtr, 0xFF); // we only return opaque
83 return true; 83 return true;
84 } 84 }
85 return false; 85 return false;
86 } 86 }
87 87
88 SkShader::Context* SkShader::createContext(const ContextRec& rec, void* storage) const { 88 SkShader::Context* SkShader::createContext(const ContextRec& rec, void* storage) const {
89 // Currently we require each context to be allocated on 16byte boundary as s ome of our
90 // subclasses need that. Hence we check the ptr here.
91 // SkASSERT(SkIsAlign16((intptr_t)storage));
92
93 if (!this->computeTotalInverse(rec, nullptr)) { 89 if (!this->computeTotalInverse(rec, nullptr)) {
94 return nullptr; 90 return nullptr;
95 } 91 }
96 return this->onCreateContext(rec, storage); 92 return this->onCreateContext(rec, storage);
97 } 93 }
98 94
99 SkShader::Context* SkShader::onCreateContext(const ContextRec& rec, void*) const { 95 SkShader::Context* SkShader::onCreateContext(const ContextRec& rec, void*) const {
100 return nullptr; 96 return nullptr;
101 } 97 }
102 98
103 size_t SkShader::contextSize(const ContextRec& rec) const { 99 size_t SkShader::contextSize(const ContextRec& rec) const {
104 size_t size = this->onContextSize(rec); 100 return this->onContextSize(rec);
105
106 // Currently we require each context to be allocated on 16byte boundary as s ome of our
107 // subclasses need that. Hence we check the size here.
108 // SkASSERT(SkIsAlign16(size));
109
110 return size;
111 } 101 }
112 102
113 size_t SkShader::onContextSize(const ContextRec&) const { 103 size_t SkShader::onContextSize(const ContextRec&) const {
114 return 0; 104 return 0;
115 } 105 }
116 106
117 SkShader::Context::Context(const SkShader& shader, const ContextRec& rec) 107 SkShader::Context::Context(const SkShader& shader, const ContextRec& rec)
118 : fShader(shader), fCTM(*rec.fMatrix) 108 : fShader(shader), fCTM(*rec.fMatrix)
119 { 109 {
120 // Because the context parameters must be valid at this point, we know that the matrix is 110 // Because the context parameters must be valid at this point, we know that the matrix is
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 #include "SkEmptyShader.h" 369 #include "SkEmptyShader.h"
380 370
381 void SkEmptyShader::toString(SkString* str) const { 371 void SkEmptyShader::toString(SkString* str) const {
382 str->append("SkEmptyShader: ("); 372 str->append("SkEmptyShader: (");
383 373
384 this->INHERITED::toString(str); 374 this->INHERITED::toString(str);
385 375
386 str->append(")"); 376 str->append(")");
387 } 377 }
388 #endif 378 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | src/core/SkSmallAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698