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

Side by Side Diff: src/gpu/GrPictureUtils.cpp

Issue 333823007: Enable basic drawing with SkRecord-based pictures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ref accel data Created 6 years, 6 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/SkPictureRecorder.cpp ('k') | src/gpu/SkGpuDevice.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 "GrPictureUtils.h" 8 #include "GrPictureUtils.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 this->updateClipConservativelyUsingBounds(path.getBounds(), op, 243 this->updateClipConservativelyUsingBounds(path.getBounds(), op,
244 path.isInverseFillType()); 244 path.isInverseFillType());
245 } 245 }
246 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e) SK_OVERRIDE { 246 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e) SK_OVERRIDE {
247 this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false); 247 this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false);
248 } 248 }
249 249
250 virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE { 250 virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE {
251 // BBH-based rendering doesn't re-issue many of the operations the gathe r 251 // BBH-based rendering doesn't re-issue many of the operations the gathe r
252 // process cares about (e.g., saves and restores) so it must be disabled . 252 // process cares about (e.g., saves and restores) so it must be disabled .
253 if (NULL != picture->fPlayback) { 253 if (NULL != picture->fPlayback.get()) {
254 picture->fPlayback->setUseBBH(false); 254 picture->fPlayback->setUseBBH(false);
255 } 255 }
256 picture->draw(this); 256 picture->draw(this);
257 if (NULL != picture->fPlayback) { 257 if (NULL != picture->fPlayback.get()) {
258 picture->fPlayback->setUseBBH(true); 258 picture->fPlayback->setUseBBH(true);
259 } 259 }
260 } 260 }
261 261
262 private: 262 private:
263 const SkPicture* fPicture; 263 const SkPicture* fPicture;
264 264
265 typedef SkCanvas INHERITED; 265 typedef SkCanvas INHERITED;
266 }; 266 };
267 267
268 // GatherGPUInfo is only intended to be called within the context of SkGpuDevice 's 268 // GatherGPUInfo is only intended to be called within the context of SkGpuDevice 's
269 // EXPERIMENTAL_optimize method. 269 // EXPERIMENTAL_optimize method.
270 void GatherGPUInfo(const SkPicture* pict, GPUAccelData* accelData) { 270 void GatherGPUInfo(const SkPicture* pict, GPUAccelData* accelData) {
271 if (0 == pict->width() || 0 == pict->height()) { 271 if (0 == pict->width() || 0 == pict->height()) {
272 return ; 272 return ;
273 } 273 }
274 274
275 GrGatherDevice device(pict->width(), pict->height(), pict, accelData, 0); 275 GrGatherDevice device(pict->width(), pict->height(), pict, accelData, 0);
276 GrGatherCanvas canvas(&device, pict); 276 GrGatherCanvas canvas(&device, pict);
277 277
278 canvas.gather(); 278 canvas.gather();
279 } 279 }
OLDNEW
« no previous file with comments | « src/core/SkPictureRecorder.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698