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

Side by Side Diff: src/pipe/SkGPipeWrite.cpp

Issue 138803005: Set write buffer flags only in SkWriteBuffer and SkFlatController constructors. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 6 years, 10 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/SkWriteBuffer.cpp ('k') | tests/SerializationTest.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 8
9 #include "SkAnnotation.h" 9 #include "SkAnnotation.h"
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 writer->writePad(data->data(), size); 64 writer->writePad(data->data(), size);
65 } 65 }
66 return 4 + SkAlign4(size); 66 return 4 + SkAlign4(size);
67 } 67 }
68 68
69 /////////////////////////////////////////////////////////////////////////////// 69 ///////////////////////////////////////////////////////////////////////////////
70 70
71 class FlattenableHeap : public SkFlatController { 71 class FlattenableHeap : public SkFlatController {
72 public: 72 public:
73 FlattenableHeap(int numFlatsToKeep, SkNamedFactorySet* fset, bool isCrossPro cess) 73 FlattenableHeap(int numFlatsToKeep, SkNamedFactorySet* fset, bool isCrossPro cess)
74 : fNumFlatsToKeep(numFlatsToKeep) { 74 : SkFlatController(isCrossProcess ? SkWriteBuffer::kCrossProcess_Flag : 0)
scroggo 2014/01/30 21:14:14 nit: We should define INHERITED to be SkFlatContro
mtklein 2014/01/30 21:16:56 Done.
75 , fNumFlatsToKeep(numFlatsToKeep) {
75 SkASSERT((isCrossProcess && fset != NULL) || (!isCrossProcess && NULL == fset)); 76 SkASSERT((isCrossProcess && fset != NULL) || (!isCrossProcess && NULL == fset));
76 if (isCrossProcess) { 77 if (isCrossProcess) {
77 this->setNamedFactorySet(fset); 78 this->setNamedFactorySet(fset);
78 this->setWriteBufferFlags(SkWriteBuffer::kCrossProcess_Flag);
79 } 79 }
80 } 80 }
81 81
82 ~FlattenableHeap() { 82 ~FlattenableHeap() {
83 fPointers.freeAll(); 83 fPointers.freeAll();
84 } 84 }
85 85
86 virtual void* allocThrow(size_t bytes) SK_OVERRIDE; 86 virtual void* allocThrow(size_t bytes) SK_OVERRIDE;
87 87
88 virtual void unalloc(void* ptr) SK_OVERRIDE; 88 virtual void unalloc(void* ptr) SK_OVERRIDE;
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 return fCanvas->shuttleBitmap(bitmap, slot); 1233 return fCanvas->shuttleBitmap(bitmap, slot);
1234 } 1234 }
1235 1235
1236 void BitmapShuttle::removeCanvas() { 1236 void BitmapShuttle::removeCanvas() {
1237 if (NULL == fCanvas) { 1237 if (NULL == fCanvas) {
1238 return; 1238 return;
1239 } 1239 }
1240 fCanvas->unref(); 1240 fCanvas->unref();
1241 fCanvas = NULL; 1241 fCanvas = NULL;
1242 } 1242 }
OLDNEW
« no previous file with comments | « src/core/SkWriteBuffer.cpp ('k') | tests/SerializationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698