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

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

Issue 855473002: initial preroll api (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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/SkBitmapProcShader.h ('k') | src/core/SkCanvas.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #include "SkColorPriv.h" 8 #include "SkColorPriv.h"
9 #include "SkReadBuffer.h" 9 #include "SkReadBuffer.h"
10 #include "SkWriteBuffer.h" 10 #include "SkWriteBuffer.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 return SkNEW_PLACEMENT_ARGS(storage, BitmapProcShaderContext, (*this, rec, s tate)); 106 return SkNEW_PLACEMENT_ARGS(storage, BitmapProcShaderContext, (*this, rec, s tate));
107 } 107 }
108 108
109 size_t SkBitmapProcShader::contextSize() const { 109 size_t SkBitmapProcShader::contextSize() const {
110 // The SkBitmapProcState is stored outside of the context object, with the c ontext holding 110 // The SkBitmapProcState is stored outside of the context object, with the c ontext holding
111 // a pointer to it. 111 // a pointer to it.
112 return sizeof(BitmapProcShaderContext) + sizeof(SkBitmapProcState); 112 return sizeof(BitmapProcShaderContext) + sizeof(SkBitmapProcState);
113 } 113 }
114 114
115 void SkBitmapProcShader::onPreroll() const {
116 SkBitmap bm(fRawBitmap);
117 bm.lockPixels();
118 bm.unlockPixels();
119 }
120
115 SkBitmapProcShader::BitmapProcShaderContext::BitmapProcShaderContext( 121 SkBitmapProcShader::BitmapProcShaderContext::BitmapProcShaderContext(
116 const SkBitmapProcShader& shader, const ContextRec& rec, SkBitmapProcSta te* state) 122 const SkBitmapProcShader& shader, const ContextRec& rec, SkBitmapProcSta te* state)
117 : INHERITED(shader, rec) 123 : INHERITED(shader, rec)
118 , fState(state) 124 , fState(state)
119 { 125 {
120 const SkBitmap& bitmap = *fState->fBitmap; 126 const SkBitmap& bitmap = *fState->fBitmap;
121 bool bitmapIsOpaque = bitmap.isOpaque(); 127 bool bitmapIsOpaque = bitmap.isOpaque();
122 128
123 // update fFlags 129 // update fFlags
124 uint32_t flags = 0; 130 uint32_t flags = 0;
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 #else 461 #else
456 462
457 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S kMatrix&, 463 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S kMatrix&,
458 const SkMatrix*, GrColor*, 464 const SkMatrix*, GrColor*,
459 GrFragmentProcessor**) const { 465 GrFragmentProcessor**) const {
460 SkDEBUGFAIL("Should not call in GPU-less build"); 466 SkDEBUGFAIL("Should not call in GPU-less build");
461 return false; 467 return false;
462 } 468 }
463 469
464 #endif 470 #endif
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcShader.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698