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

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: 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
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 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 void SkCanvas::drawTextOnPathHV(const void* text, size_t byteLength, 2397 void SkCanvas::drawTextOnPathHV(const void* text, size_t byteLength,
2398 const SkPath& path, SkScalar hOffset, 2398 const SkPath& path, SkScalar hOffset,
2399 SkScalar vOffset, const SkPaint& paint) { 2399 SkScalar vOffset, const SkPaint& paint) {
2400 SkMatrix matrix; 2400 SkMatrix matrix;
2401 2401
2402 matrix.setTranslate(hOffset, vOffset); 2402 matrix.setTranslate(hOffset, vOffset);
2403 this->drawTextOnPath(text, byteLength, path, &matrix, paint); 2403 this->drawTextOnPath(text, byteLength, path, &matrix, paint);
2404 } 2404 }
2405 2405
2406 /////////////////////////////////////////////////////////////////////////////// 2406 ///////////////////////////////////////////////////////////////////////////////
2407 void SkCanvas::drawPicture(SkPicture& picture) {
2408 SkBaseDevice* device = this->getDevice();
2409 if (NULL != device) {
2410 if (device->optimizedRender(picture)) {
2411 return; // the device has rendered the entire picture
2412 }
2413 }
2407 2414
2408 void SkCanvas::drawPicture(SkPicture& picture) {
2409 picture.draw(this); 2415 picture.draw(this);
2410 } 2416 }
2411 2417
2412 /////////////////////////////////////////////////////////////////////////////// 2418 ///////////////////////////////////////////////////////////////////////////////
2413 /////////////////////////////////////////////////////////////////////////////// 2419 ///////////////////////////////////////////////////////////////////////////////
2414 2420
2415 SkCanvas::LayerIter::LayerIter(SkCanvas* canvas, bool skipEmptyClips) { 2421 SkCanvas::LayerIter::LayerIter(SkCanvas* canvas, bool skipEmptyClips) {
2416 SK_COMPILE_ASSERT(sizeof(fStorage) >= sizeof(SkDrawIter), fStorage_too_small ); 2422 SK_COMPILE_ASSERT(sizeof(fStorage) >= sizeof(SkDrawIter), fStorage_too_small );
2417 2423
2418 SkASSERT(canvas); 2424 SkASSERT(canvas);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
2485 if (!bitmap.allocPixels(info)) { 2491 if (!bitmap.allocPixels(info)) {
2486 return NULL; 2492 return NULL;
2487 } 2493 }
2488 2494
2489 // should this functionality be moved into allocPixels()? 2495 // should this functionality be moved into allocPixels()?
2490 if (!bitmap.info().isOpaque()) { 2496 if (!bitmap.info().isOpaque()) {
2491 bitmap.eraseColor(0); 2497 bitmap.eraseColor(0);
2492 } 2498 }
2493 return SkNEW_ARGS(SkCanvas, (bitmap)); 2499 return SkNEW_ARGS(SkCanvas, (bitmap));
2494 } 2500 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698