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

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

Issue 1057363004: Move function to be static instead of anonymous namespace (Closed) Base URL: https://skia.googlesource.com/skia.git@reorgCreateTexture
Patch Set: Created 5 years, 8 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 | « no previous file | src/gpu/gl/GrGLGpu.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 2010 Google Inc. 3 * Copyright 2010 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 9
10 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 GrGpu::~GrGpu() { 32 GrGpu::~GrGpu() {
33 SkSafeSetNull(fQuadIndexBuffer); 33 SkSafeSetNull(fQuadIndexBuffer);
34 } 34 }
35 35
36 void GrGpu::contextAbandoned() {} 36 void GrGpu::contextAbandoned() {}
37 37
38 //////////////////////////////////////////////////////////////////////////////// 38 ////////////////////////////////////////////////////////////////////////////////
39 39
40 namespace { 40 static GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin, bool renderTarget) {
41
42 GrSurfaceOrigin resolve_origin(GrSurfaceOrigin origin, bool renderTarget) {
43 // By default, GrRenderTargets are GL's normal orientation so that they 41 // By default, GrRenderTargets are GL's normal orientation so that they
44 // can be drawn to by the outside world without the client having 42 // can be drawn to by the outside world without the client having
45 // to render upside down. 43 // to render upside down.
46 if (kDefault_GrSurfaceOrigin == origin) { 44 if (kDefault_GrSurfaceOrigin == origin) {
47 return renderTarget ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOr igin; 45 return renderTarget ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOr igin;
48 } else { 46 } else {
49 return origin; 47 return origin;
50 } 48 }
51 } 49 }
52 50
53 }
54
55 GrTexture* GrGpu::createTexture(const GrSurfaceDesc& origDesc, bool budgeted, 51 GrTexture* GrGpu::createTexture(const GrSurfaceDesc& origDesc, bool budgeted,
56 const void* srcData, size_t rowBytes) { 52 const void* srcData, size_t rowBytes) {
57 GrSurfaceDesc desc = origDesc; 53 GrSurfaceDesc desc = origDesc;
58 54
59 if (!this->caps()->isConfigTexturable(desc.fConfig)) { 55 if (!this->caps()->isConfigTexturable(desc.fConfig)) {
60 return NULL; 56 return NULL;
61 } 57 }
62 58
63 bool isRT = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag); 59 bool isRT = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag);
64 if (isRT && !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { 60 if (isRT && !this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 GrDrawTarget::PathIndexType indexType, 351 GrDrawTarget::PathIndexType indexType,
356 const float transformValues[], 352 const float transformValues[],
357 GrDrawTarget::PathTransformType transformType, 353 GrDrawTarget::PathTransformType transformType,
358 int count, 354 int count,
359 const GrStencilSettings& stencilSettings) { 355 const GrStencilSettings& stencilSettings) {
360 this->handleDirtyContext(); 356 this->handleDirtyContext();
361 pathRange->willDrawPaths(indices, indexType, count); 357 pathRange->willDrawPaths(indices, indexType, count);
362 this->onDrawPaths(args, pathRange, indices, indexType, transformValues, 358 this->onDrawPaths(args, pathRange, indices, indexType, transformValues,
363 transformType, count, stencilSettings); 359 transformType, count, stencilSettings);
364 } 360 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698