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

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

Issue 768183002: Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/SkPathEffect.cpp ('k') | src/core/SkShader.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 2014 Google Inc. 2 * Copyright 2014 Google Inc.
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 "SkPictureShader.h" 8 #include "SkPictureShader.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 SkPictureShader::SkPictureShader(const SkPicture* picture, TileMode tmx, TileMod e tmy, 94 SkPictureShader::SkPictureShader(const SkPicture* picture, TileMode tmx, TileMod e tmy,
95 const SkMatrix* localMatrix, const SkRect* tile ) 95 const SkMatrix* localMatrix, const SkRect* tile )
96 : INHERITED(localMatrix) 96 : INHERITED(localMatrix)
97 , fPicture(SkRef(picture)) 97 , fPicture(SkRef(picture))
98 , fTile(tile ? *tile : picture->cullRect()) 98 , fTile(tile ? *tile : picture->cullRect())
99 , fTmx(tmx) 99 , fTmx(tmx)
100 , fTmy(tmy) { 100 , fTmy(tmy) {
101 } 101 }
102 102
103 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
104 SkPictureShader::SkPictureShader(SkReadBuffer& buffer) : INHERITED(buffer) {
105 fTmx = static_cast<SkShader::TileMode>(buffer.read32());
106 fTmy = static_cast<SkShader::TileMode>(buffer.read32());
107 buffer.readRect(&fTile);
108 fPicture = SkPicture::CreateFromBuffer(buffer);
109 }
110 #endif
111
103 SkPictureShader::~SkPictureShader() { 112 SkPictureShader::~SkPictureShader() {
104 fPicture->unref(); 113 fPicture->unref();
105 } 114 }
106 115
107 SkPictureShader* SkPictureShader::Create(const SkPicture* picture, TileMode tmx, TileMode tmy, 116 SkPictureShader* SkPictureShader::Create(const SkPicture* picture, TileMode tmx, TileMode tmy,
108 const SkMatrix* localMatrix, const SkRe ct* tile) { 117 const SkMatrix* localMatrix, const SkRe ct* tile) {
109 if (!picture || picture->cullRect().isEmpty() || (tile && tile->isEmpty())) { 118 if (!picture || picture->cullRect().isEmpty() || (tile && tile->isEmpty())) {
110 return NULL; 119 return NULL;
111 } 120 }
112 return SkNEW_ARGS(SkPictureShader, (picture, tmx, tmy, localMatrix, tile)); 121 return SkNEW_ARGS(SkPictureShader, (picture, tmx, tmy, localMatrix, tile));
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 297 }
289 return bitmapShader->asFragmentProcessor(context, paint, NULL, paintColor, f p); 298 return bitmapShader->asFragmentProcessor(context, paint, NULL, paintColor, f p);
290 } 299 }
291 #else 300 #else
292 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa trix*, GrColor*, 301 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa trix*, GrColor*,
293 GrFragmentProcessor**) const { 302 GrFragmentProcessor**) const {
294 SkDEBUGFAIL("Should not call in GPU-less build"); 303 SkDEBUGFAIL("Should not call in GPU-less build");
295 return false; 304 return false;
296 } 305 }
297 #endif 306 #endif
OLDNEW
« no previous file with comments | « src/core/SkPathEffect.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698