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

Side by Side Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1310843007: Various minor cross-platform changes (Closed) Base URL: https://chromium.googlesource.com/skia@master
Patch Set: Update to ToT Created 5 years, 3 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/gpu/GrGpu.cpp ('k') | no next file » | 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 2011 Google Inc. 2 * Copyright 2011 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 8
9 #include "GrGLGpu.h" 9 #include "GrGLGpu.h"
10 #include "GrGLGLSL.h" 10 #include "GrGLGLSL.h"
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 ElevateDrawPreference(drawPreference, kGpuPrefersDraw_DrawPreference); 557 ElevateDrawPreference(drawPreference, kGpuPrefersDraw_DrawPreference);
558 } 558 }
559 559
560 return true; 560 return true;
561 } 561 }
562 562
563 bool GrGLGpu::onWritePixels(GrSurface* surface, 563 bool GrGLGpu::onWritePixels(GrSurface* surface,
564 int left, int top, int width, int height, 564 int left, int top, int width, int height,
565 GrPixelConfig config, const void* buffer, 565 GrPixelConfig config, const void* buffer,
566 size_t rowBytes) { 566 size_t rowBytes) {
567 if (nullptr == buffer) {
568 return false;
569 }
570
571 GrGLTexture* glTex = static_cast<GrGLTexture*>(surface->asTexture()); 567 GrGLTexture* glTex = static_cast<GrGLTexture*>(surface->asTexture());
572 if (!glTex) { 568 if (!glTex) {
573 return false; 569 return false;
574 } 570 }
575 571
576 // OpenGL doesn't do sRGB <-> linear conversions when reading and writing pi xels. 572 // OpenGL doesn't do sRGB <-> linear conversions when reading and writing pi xels.
577 if (GrPixelConfigIsSRGB(surface->config()) != GrPixelConfigIsSRGB(config)) { 573 if (GrPixelConfigIsSRGB(surface->config()) != GrPixelConfigIsSRGB(config)) {
578 return false; 574 return false;
579 } 575 }
580 576
(...skipping 2610 matching lines...) Expand 10 before | Expand all | Expand 10 after
3191 this->setVertexArrayID(gpu, 0); 3187 this->setVertexArrayID(gpu, 0);
3192 } 3188 }
3193 int attrCount = gpu->glCaps().maxVertexAttributes(); 3189 int attrCount = gpu->glCaps().maxVertexAttributes();
3194 if (fDefaultVertexArrayAttribState.count() != attrCount) { 3190 if (fDefaultVertexArrayAttribState.count() != attrCount) {
3195 fDefaultVertexArrayAttribState.resize(attrCount); 3191 fDefaultVertexArrayAttribState.resize(attrCount);
3196 } 3192 }
3197 attribState = &fDefaultVertexArrayAttribState; 3193 attribState = &fDefaultVertexArrayAttribState;
3198 } 3194 }
3199 return attribState; 3195 return attribState;
3200 } 3196 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698