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

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

Issue 197123003: Proposed SkCanvas API for preLoading textures to VRAM v2.0 (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: retry upload Created 6 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 | Annotate | Revision Log
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | src/core/SkDevice.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 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
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 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 2443 matching lines...) Expand 10 before | Expand all | Expand 10 after
2454 void SkCanvas::drawTextOnPathHV(const void* text, size_t byteLength, 2454 void SkCanvas::drawTextOnPathHV(const void* text, size_t byteLength,
2455 const SkPath& path, SkScalar hOffset, 2455 const SkPath& path, SkScalar hOffset,
2456 SkScalar vOffset, const SkPaint& paint) { 2456 SkScalar vOffset, const SkPaint& paint) {
2457 SkMatrix matrix; 2457 SkMatrix matrix;
2458 2458
2459 matrix.setTranslate(hOffset, vOffset); 2459 matrix.setTranslate(hOffset, vOffset);
2460 this->drawTextOnPath(text, byteLength, path, &matrix, paint); 2460 this->drawTextOnPath(text, byteLength, path, &matrix, paint);
2461 } 2461 }
2462 2462
2463 /////////////////////////////////////////////////////////////////////////////// 2463 ///////////////////////////////////////////////////////////////////////////////
2464 void SkCanvas::EXPERIMENTAL_optimize(SkPicture* picture) {
2465 SkBaseDevice* device = this->getDevice();
2466 if (NULL != device) {
2467 device->EXPERIMENTAL_optimize(picture);
2468 }
2469 }
2464 2470
2465 void SkCanvas::drawPicture(SkPicture& picture) { 2471 void SkCanvas::drawPicture(SkPicture& picture) {
2472 SkBaseDevice* device = this->getTopDevice();
2473 if (NULL != device) {
2474 // Canvas has to first give the device the opportunity to render
2475 // the picture itself.
2476 if (device->EXPERIMENTAL_drawPicture(picture)) {
2477 return; // the device has rendered the entire picture
2478 }
2479 }
2480
2466 picture.draw(this); 2481 picture.draw(this);
2467 } 2482 }
2468 2483
2469 /////////////////////////////////////////////////////////////////////////////// 2484 ///////////////////////////////////////////////////////////////////////////////
2470 /////////////////////////////////////////////////////////////////////////////// 2485 ///////////////////////////////////////////////////////////////////////////////
2471 2486
2472 SkCanvas::LayerIter::LayerIter(SkCanvas* canvas, bool skipEmptyClips) { 2487 SkCanvas::LayerIter::LayerIter(SkCanvas* canvas, bool skipEmptyClips) {
2473 SK_COMPILE_ASSERT(sizeof(fStorage) >= sizeof(SkDrawIter), fStorage_too_small ); 2488 SK_COMPILE_ASSERT(sizeof(fStorage) >= sizeof(SkDrawIter), fStorage_too_small );
2474 2489
2475 SkASSERT(canvas); 2490 SkASSERT(canvas);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 if (!bitmap.allocPixels(info)) { 2557 if (!bitmap.allocPixels(info)) {
2543 return NULL; 2558 return NULL;
2544 } 2559 }
2545 2560
2546 // should this functionality be moved into allocPixels()? 2561 // should this functionality be moved into allocPixels()?
2547 if (!bitmap.info().isOpaque()) { 2562 if (!bitmap.info().isOpaque()) {
2548 bitmap.eraseColor(0); 2563 bitmap.eraseColor(0);
2549 } 2564 }
2550 return SkNEW_ARGS(SkCanvas, (bitmap)); 2565 return SkNEW_ARGS(SkCanvas, (bitmap));
2551 } 2566 }
OLDNEW
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698